Example #1
0
 public void OnMouseOverPotentiallyWalkable(Vector3 destination)
 {
     if (Input.GetMouseButton(0))
     {
         StopAllCoroutines();
         weaponSystem.StopAttacking();
         currentEnemy = null;
         character.SetDesination(destination);
     }
 }
Example #2
0
 IEnumerator Patrol()
 {
     state = State.patrolling;
     while (patrolPath != null)
     {
         Vector3 nextWaypointPos = patrolPath.transform.GetChild(nextWaypointIndex).position;
         character.SetDesination(nextWaypointPos);
         CycleWaypointWhenClose(nextWaypointPos);
         yield return(new WaitForSeconds(waypointDwellTime));
     }
 }