revival/game/Assets/PathCreator/Examples/Scripts/PathSpawner.cs

25 lines
660 B
C#
Raw Normal View History

2021-03-12 15:33:05 +01:00
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;
}
}
}
}