コード例 #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;
 }