标签:col switch velocity == else state mat style lse
void SwitchAnim() { if (isGround) { if (state != State.PlayerIdle && ((state == State.PlayerRun && Mathf.Abs(rb.velocity.x) < 0.01f) || state == State.PlayerFall)) { anim.SetTrigger("PlayerIdle"); state = State.PlayerIdle; } else if (state != State.PlayerRun && (state == State.PlayerIdle && Mathf.Abs(rb.velocity.x) > 0.01f)) { anim.SetTrigger("PlayerRun"); state = State.PlayerRun; } } else if (!isGround) { if (state != State.PlayerJump && (state == State.PlayerIdle || state == State.PlayerRun || state == State.PlayerFall)) { if (rb.velocity.y > 0) { anim.SetTrigger("PlayerJump"); state = State.PlayerJump; } } else if (state != State.PlayerFall && (state == State.PlayerJump || state == State.PlayerIdle || state == State.PlayerRun)) { if (rb.velocity.y < 0) { anim.SetTrigger("PlayerFall"); state = State.PlayerFall; } } } } }
标签:col switch velocity == else state mat style lse
原文地址:https://www.cnblogs.com/howld/p/12290548.html