Esempio n. 1
0
 // state logic
 public void SetState(POPPER_STATE _state)
 {
     if (currentState != _state)
     {
         POPPER_STATE _prevState = currentState;
         currentState = _state;
         prevState    = _prevState;
         OnStateChange(_prevState);
     }
 }
Esempio n. 2
0
 protected void OnStateChange(POPPER_STATE _from)
 {
     switch (currentState)
     {
     case POPPER_STATE.DESTROY: {
         // changing state to destroy.
         currentPopper.SetActive(false);
         projectileParent.SetActive(true);
         gameObject.GetComponentInChildren <ProjectileController>().StartExplotion();
         SetState(POPPER_STATE.INACTIVE);
         break;
     }
     }
 }