private void Start() { ds = FindObjectOfType <DroneSpawner>(); nav.speed = speed; // setting speed of enemy nav = GetComponent <NavMeshAgent>(); // accessing the nav mesh agent nav.SetDestination(waypoints[currWaypoint].position); // sets the destination of the nav mesh agent GotoNextPoint(); }
/// <summary> /// Sets a reference to the Drone spawner governing its spawning. /// Used to notify the spawner when it's destroyed. /// </summary> /// <param name="spawner">Reference to the scene's DroneSpawner component.</param> public void SetMySpawner(DroneSpawner spawner) { this.spawner = spawner; }
public void SetMySpawner(DroneSpawner spawner) { mySpawner = spawner; }
// Start is called before the first frame update void Start() { ds = FindObjectOfType <DroneSpawner>(); }