Exemplo n.º 1
0
 IEnumerator FollowPath(List <Waypoint> path)  //IEnumerator returns a value and creates a co-routine
 {
     print("Starting Patrol");
     foreach (Waypoint cubeWaypoint in path)
     {
         transform.position = cubeWaypoint.transform.position;
         //if(enemyHealth.GetIsEnemyAlive() == false)
         //{
         //    Destroy(gameObject);
         //}
         yield return(new WaitForSeconds(1f));
     }
     enemyHealth.DamageBase(new Vector3(transform.position.x, transform.position.y + 10, transform.position.z));
 }