public void OnMouseOverPotentiallyWalkable(Vector3 destination) { if (Input.GetMouseButton(0)) { StopAllCoroutines(); weaponSystem.StopAttacking(); currentEnemy = null; character.SetDesination(destination); } }
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)); } }