Exemple #1
0
 /// <summary>
 /// Inizializzo la state machine e posiziono la unit in uno spawnPoint.
 /// </summary>
 void setupStateMachine()
 {
     SM = GetComponent <UnitStateMachine>();
     if (SM == null)
     {
         Debug.LogError(string.Format("SM not found!"));
         return;
     }
     SM.Setup(this);
     transform.position = GM.I.GetRandomSpownPosition(Vector3.zero);
     SM.CurrentState    = UnitState.idle;
 }
Exemple #2
0
        public void StateMachineSetUp()
        {
            SM = GetComponent <UnitStateMachine>();
            SM.SetUp(this);
            if (SM == null)
            {
                Debug.LogError("SM not found");
            }

            else
            {
                SM.CurrentState = UnitState.idle;
            }
        }
Exemple #3
0
 protected void Update()
 {
     SM = GetComponent <UnitStateMachine>();
     //GetComponentInChildren<TextBox>().SetText(SM.CurrentState.ToString());
 }