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; } }
public void OnStartWalk() { if (currentState != StateAnimationPinguin.Walk) { iaController.startWalking(); currentState = StateAnimationPinguin.Walk; } }
// Use this for initialization void Start() { currentState = StateAnimationPinguin.Walk; }