private void ChangeStatus(EPlayerState ePlayerState, KeyCode keyCode = KeyCode.JoystickButton9) { if (ePlayerState != playerStatus.PlayerState) { playerStatus.OnExit(); switch (ePlayerState) { case EPlayerState.Idle: playerStatus = new PlayerIdle(gameObject); break; case EPlayerState.Run: playerStatus = new PlayerRun(gameObject); break; case EPlayerState.Atk: playerStatus = new PlayerAttack(gameObject, keyCode); break; case EPlayerState.Hit: break; case EPlayerState.Die: break; case EPlayerState.Jump: playerStatus = new PlayerJamp(gameObject); break; default: break; } playerStatus.OnStart(); } }