// Use this for initialization void Start() { waypoint = FindObjectOfType <WayPointsScript>(); moveDir = Vector3.zero; transform.position = waypoint.StartPosition(); player = GameObject.FindGameObjectWithTag("Player").gameObject.transform; }
/// <summary> /// Sets the module. /// </summary> /// <param name="spawnP">Spawn p.</param> /// <param name="wayP">Way p.</param> public void SetModule(Transform spawnP, WayPointsScript wayP) { spawnPoint [moduleIndex] = spawnP; wayPoints [moduleIndex] = wayP; moduleIndex++; }
//WaveSpawner will use this to set the waypoint public void SetWayPoints(WayPointsScript wayP) { wayPoints = wayP; }
private void Awake() { spawnPoint = GetComponentInChildren <SpawnPointScript> ().transform; wayPoints = GetComponentInChildren <WayPointsScript> (); }