//TODO: Make inheritable? But don't ever use it. public virtual void resetTriggers(Animator animator) { if (animator == null) { return; } if (animationStateHandlers == null) { setAnimStateHandlers(); } if (tag != "Player") { foreach (var state in animationStates) { if (currentState.Equals(state.Key)) { animator.SetTrigger(state.Value); animationStateHandlers [state.Key] (); } } foreach (var state in animationStates) { if (!currentState.Equals(state.Key)) { animator.ResetTrigger(state.Value); } } } }
private void ChangeCurrentState(ObjectState state) { if (state.Equals(ObjectState.Idle) || state.Equals(ObjectState.Walking)) { CanRoll = true; CanSetTrap = true; } else { CanRoll = false; CanSetTrap = false; } if (CurrentState != state) { currentStateDuration = 0; CurrentState = state; } }