rabidus-test/Assets/PathCreator/Examples/Scripts/PathSpawner.cs

25 lines
660 B
C#
Raw Permalink Normal View History

2023-07-24 16:38:13 +03: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;
}
}
}
}