// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { LemmingAnimationController lemmingAnimationController = animator.gameObject.GetComponent <LemmingAnimationController>(); lemmingAnimationController.setActiveUmbrella(true); lemmingAnimationController.setUmbrellaAnimation(true); AudioManager.Instance.playSFX(AudioManager.Instance.umbrellaOpen); }
private void Awake() { lemmingAnimationController = GetComponent <LemmingAnimationController>(); movementController = GetComponent <LemmingMovementController>(); movementController.OnArrived += OnArrivetAtWaypoint; movementController.OnGetNextWaypoint += OnGetNextWaypoint; stateController = GetComponent <LemmingStateController>(); SetupStateMachine(); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { LemmingAnimationController lemmingAnimationController = animator.gameObject.GetComponent <LemmingAnimationController>(); lemmingAnimationController.setActivePickaxe(true); AudioManager.Instance.playSFX(AudioManager.Instance.pickaxeHit); if (stateInfo.IsName("DigForward")) { lemmingAnimationController.setDigForwardPickaxeAnimation(); } else if (stateInfo.IsName("DigDown")) { lemmingAnimationController.setDigDownPickaxeAnimation(); } }