public void Standing() { if (actualState == States.Standing) return; if (actualState == States.Jumping) return; //if (actualState == States.Kicked) // return; if (actualState == States.Falling) return; if (actualState == States.BadJump) return; //if (actualState == States.KnockOut) // return; if (actualKickedFrames != 0) return; AudioMgr.Instance.PlaySoundFx(AudioMgr.AudioFx.Standing); avatarState = standingState; actualState = States.Standing; primaryAnimator.SetInteger(stateName, (int)States.Standing); }
// Use this for initialization void Start() { primaryAnimator = primaryTransform.GetComponent<Animator>(); _transform = GetComponent<Transform>(); avatarState = standingState; }
public void KnockOut() { AudioMgr.Instance.PlaySoundFx(AudioMgr.AudioFx.KnockOut); avatarState = knockOutState; actualState = States.KnockOut; }
public void Falling() { AudioMgr.Instance.PlaySoundFx(AudioMgr.AudioFx.Falling); avatarState = fallingState; actualState = States.Falling; primaryAnimator.SetInteger(stateName, (int)States.Falling); }
public void Kicked() { //if (actualState == States.KnockOut) // return; avatarState = kickedState; actualState = States.Kicked; primaryAnimator.SetInteger(stateName, (int)States.KnockOut); }
public void BadJump() { if (actualState == States.KnockOut) return; AudioMgr.Instance.PlaySoundFx(AudioMgr.AudioFx.BadJump); avatarState = badJumpState; actualState = States.BadJump; primaryAnimator.SetInteger(stateName, (int)States.BadJump); }
public void Jump() { if (actualState == States.RunningRight || actualState == States.RunningLeft || actualState == States.Standing) { AudioMgr.Instance.PlaySoundFx(AudioMgr.AudioFx.GoodJump); avatarState = jumpingState; actualState = States.Jumping; primaryAnimator.SetInteger(stateName, (int)States.Jumping); } }
public void RunLeft() { if (actualState == States.RunningLeft) return; if (actualState == States.RunningRight || actualState == States.Standing) { AudioMgr.Instance.PlaySoundFx(AudioMgr.AudioFx.Running); avatarState = runningLeftState; actualState = States.RunningLeft; primaryAnimator.SetInteger(stateName, (int)States.RunningLeft); } }