Exemple #1
0
 public void CompleteAction()
 {
     if (storedAttackAction != null)
     {
         Debug.Log("Finishing an Attack action.");
         attackActions.Add(storedAttackAction);
         storedAttackAction = null;
     }
     if (storedDefenceAction != null)
     {
         Debug.Log("Finishing a Defence action.");
         defenceActions.Add(storedDefenceAction);
         storedDefenceAction = null;
     }
     if (storedReconAction != null)
     {
         Debug.Log("Finishing a Recon action.");
         reconActions.Add(storedReconAction);
         storedReconAction = null;
     }
 }
Exemple #2
0
    public IEnumerator ActionLoop()
    {
        for (int i = 0; i < attackActions.Count; i++)
        {
            AttackAction aA = attackActions[i];
            aA.ExecuteAction();
        }
        yield return(new WaitForSeconds(1f));

        for (int i = 0; i < defenceActions.Count; i++)
        {
            DefenceAction dA = defenceActions[i];
            dA.ExecuteAction();
        }
        yield return(new WaitForSeconds(1f));

        for (int i = 0; i < reconActions.Count; i++)
        {
            ReconAction rA = reconActions[i];
            rA.ExecuteAction();
        }
        ClearActions();
    }