This repository has been archived on 2025-03-10. You can view files and clone it, but cannot push or open issues or pull requests.
rabidus-test/Assets/PathCreator/Examples/Scripts/PathSpawner.cs

25 lines
660 B
C#

using System.Collections;
using System.Collections.Generic;
using PathCreation;
using UnityEngine;
namespace PathCreation.Examples {
public class PathSpawner : MonoBehaviour {
public PathCreator pathPrefab;
public PathFollower followerPrefab;
public Transform[] spawnPoints;
void Start () {
foreach (Transform t in spawnPoints) {
var path = Instantiate (pathPrefab, t.position, t.rotation);
var follower = Instantiate (followerPrefab);
follower.pathCreator = path;
path.transform.parent = t;
}
}
}
}