Exemple #1
0
 protected void Start()
 {
     if (state == null)
     {
         //Start in wanderer state by default
         state = gameObject.GetComponent <WandererState>();
         ChangeState(state);
     }
     bubbleText.text = number.ToString();
 }
Exemple #2
0
 //Change current state and enable/disable appriopriate components?
 public void ChangeState(BubbleState newState)
 {
     if (state != null)
     {
         state.Deactivate();
         state.enabled = false;
     }
     state         = newState;
     state.enabled = true;
     newState.Activate();
 }