public void UpdateAnimatorState(AnimatorStateEnum state) { //Debug.Log(playerNumber + "to : " + state); switch (state) { case AnimatorStateEnum.walkUp: walkUp = true; walkRight = false; walkDown = false; walkLeft = false; break; case AnimatorStateEnum.walkRight: walkUp = false; walkRight = true; walkDown = false; walkLeft = false; break; case AnimatorStateEnum.walkDown: walkUp = false; walkRight = false; walkDown = true; walkLeft = false; break; case AnimatorStateEnum.walkLeft: walkUp = false; walkRight = false; walkDown = false; walkLeft = true; break; case AnimatorStateEnum.stop: walkUp = false; walkRight = false; walkDown = false; walkLeft = false; break; case AnimatorStateEnum.dead: walkUp = false; walkRight = false; walkDown = false; walkLeft = false; dead = true; break; } characterAnimator.SetBool("walkUp", walkUp); characterAnimator.SetBool("walkDown", walkDown); characterAnimator.SetBool("walkRight", walkRight); characterAnimator.SetBool("walkLeft", walkLeft); characterAnimator.SetBool("dead", dead); if (dead) { } }
public void UpdateAnimatorState(AnimatorStateEnum state) { //Debug.Log(playerNumber + "to : " + state); switch (state) { case AnimatorStateEnum.walkUp: walkUp = true; walkRight = false; walkDown = false; walkLeft= false; break; case AnimatorStateEnum.walkRight: walkUp = false; walkRight = true; walkDown = false; walkLeft = false; break; case AnimatorStateEnum.walkDown: walkUp = false; walkRight = false; walkDown = true; walkLeft = false; break; case AnimatorStateEnum.walkLeft: walkUp = false; walkRight = false; walkDown = false; walkLeft = true; break; case AnimatorStateEnum.stop: walkUp = false; walkRight = false; walkDown = false; walkLeft = false; break; case AnimatorStateEnum.dead: walkUp = false; walkRight = false; walkDown = false; walkLeft = false; dead = true; break; } characterAnimator.SetBool("walkUp", walkUp); characterAnimator.SetBool("walkDown", walkDown); characterAnimator.SetBool("walkRight", walkRight); characterAnimator.SetBool("walkLeft", walkLeft); characterAnimator.SetBool("dead", dead); if (dead) { } }