Пример #1
0
 public void CheckForCombat()
 {
     if (CheckLocalVision() || tm.visibleEnemies.Count > 0)
     {
         currentState = attackState;
         //attack priority moved to attackState
     }
 }
Пример #2
0
 //called by strategy when switching from ai -> player
 public void ResetOnSwitch()
 {
     targetedEnemy = null;
     currentState  = idleState;
     StopAllCoroutines();
     navMeshAgent.speed = navSpeedDefault;
     if (abilities != null)
     {
         activeSpecialAbility = null;
     }
 }
Пример #3
0
    private IEnumerator DefendRoutine(float delay)
    {
        currentState = defendState;
        yield return(new WaitForFixedUpdate());

        currentState = defendState;
        yield return(new WaitForFixedUpdate());

        navMeshAgent.Resume();
        yield return(new WaitForSeconds(delay));

        if (currentState == defendState)
        {
            currentState = idleState;
        }
    }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     currentState = idleState;
 }