예제 #1
0
 public void playAnimation(newStateAnimationPinguin state)
 {
     switch (state)
     {
         case newStateAnimationPinguin.Throw:
             animator.SetTrigger("Throw");
             currentState = StateAnimationPinguin.Throw;
             break;
         case newStateAnimationPinguin.Dive:
             animator.SetTrigger("Dive");
             currentState = StateAnimationPinguin.Dive;
             break;
         case newStateAnimationPinguin.Eat:
             animator.SetTrigger("Eat");
             currentState = StateAnimationPinguin.Eat;
             break;
         case newStateAnimationPinguin.DanceThenDive:
             animator.SetTrigger("DiveAfterDance");
             animator.SetTrigger("Dance");
             currentState = StateAnimationPinguin.DanceThenDive;
             break;
         case newStateAnimationPinguin.DanceThenEat:
             animator.SetTrigger("EatAfterDance");
             animator.SetTrigger("Dance");
             currentState = StateAnimationPinguin.DanceThenEat;
             break;
     }
 }
예제 #2
0
 public void OnStartWalk()
 {
     if (currentState != StateAnimationPinguin.Walk)
     {
         iaController.startWalking();
         currentState = StateAnimationPinguin.Walk;
     }
 }
예제 #3
0
 // Use this for initialization
 void Start()
 {
     currentState = StateAnimationPinguin.Walk;
 }