private void UpdateDesireVariableFromKey(core.InputAction inInputAction, out bool ioVariable) { ioVariable = false; if (inInputAction == core.InputAction.Pressed) { ioVariable = true; } else if (inInputAction == core.InputAction.Released) { ioVariable = false; } }
private void UpdateDesireFloatFromKey(core.InputAction inInputAction, out float ioVariable) { ioVariable = 0.0f; if (inInputAction == core.InputAction.Pressed) { ioVariable = 1.0f; } else if (inInputAction == core.InputAction.Released) { ioVariable = 0.0f; } }
public void HandleInputStick(core.InputAction inInputAction, eJoyStickType eJoyStick, float fAngle) { if (inInputAction == InputAction.Released) { HandleInputSticPointUp(eJoyStick); return; } switch (eJoyStick) { case eJoyStickType.eMOVESTICK: m_kCurrentState.mDirection = (uint)fAngle; m_kCurrentState.mIsMove = true; break; case eJoyStickType.eBOMBSTICK: break; } }
public void HandleInput(core.InputAction inInputAction, KeyCode inKeyCode) { //ACBattleCharacter battleCharacter = m_kMoveJoyStick._battleCharacter; switch (inKeyCode) { case KeyCode.A: UpdateDesireVariableFromKey(inInputAction, out mIsLeft); break; case KeyCode.D: UpdateDesireVariableFromKey(inInputAction, out mIsRight); break; case KeyCode.W: UpdateDesireVariableFromKey(inInputAction, out mIsForward); break; case KeyCode.S: UpdateDesireVariableFromKey(inInputAction, out mIsBack); break; case KeyCode.K: //battleCharacter.m_kActorSkillManager.IsSkillState(SkillStateMachine.StateType.SkillAutoTargetState, eJoyStickType.eSKILLSTICK); //bool isShoot = battleCharacter.m_kActorSkillManager.SkillCasting(eJoyStickType.eSKILLSTICK, true); //if (isShoot) // battleCharacter.m_kActorSkillManager.SetAttackButtonFlag(false); //UpdateDesireVariableFromKey(inInputAction, out m_kCurrentState.mIsShooting); break; case KeyCode.B: //battleCharacter.m_kActorSkillManager.IsSkillState(SkillStateMachine.StateType.SkillAutoTargetState, eJoyStickType.eBOMBSTICK); //isShoot = battleCharacter.m_kActorSkillManager.SkillCasting(eJoyStickType.eBOMBSTICK, true); //if (isShoot) // battleCharacter.m_kActorSkillManager.SetAttackButtonFlag(false); //UpdateDesireVariableFromKey(inInputAction, out m_kCurrentState.mIsBomb); break; } if (mIsForward && mIsRight) { m_kCurrentState.mDirection = 45; m_kCurrentState.mIsMove = true; } else if (mIsForward && mIsLeft) { m_kCurrentState.mDirection = 135; m_kCurrentState.mIsMove = true; } else if (mIsBack && mIsRight) { m_kCurrentState.mDirection = 315; m_kCurrentState.mIsMove = true; } else if (mIsBack && mIsLeft) { m_kCurrentState.mDirection = 225; m_kCurrentState.mIsMove = true; } else if (mIsForward) { m_kCurrentState.mDirection = 90; m_kCurrentState.mIsMove = true; } else if (mIsBack) { m_kCurrentState.mDirection = 270; m_kCurrentState.mIsMove = true; } else if (mIsLeft) { m_kCurrentState.mDirection = 180; m_kCurrentState.mIsMove = true; } else if (mIsRight) { m_kCurrentState.mDirection = 0; m_kCurrentState.mIsMove = true; } else { m_kCurrentState.mIsMove = false; //m_kPendingMove = SampleInputAsMove(); } //진영별 카메라 세팅 처리. if (m_kCurrentState.mIsMove == true) { m_kCurrentState.mDirection += (uint)Camera.main.transform.localEulerAngles.y; if (m_kCurrentState.mDirection >= 360) { m_kCurrentState.mDirection -= 360; } } //if (!battleCharacter.m_bisDied && !battleCharacter.IsNoMove) //{ // if (m_kCurrentState.mIsMove == false) // { // if (battleCharacter.IsPlayerStateInSkill()) // SmbManager.SetState(battleCharacter.m_kAnimator, PlayerState.Idle); // m_ePlayState은 바꾸지 않고 하체 animation 만 바꿈 // else // battleCharacter.SetActionState(PlayerState.Idle); // } // else // { // if (battleCharacter.IsPlayerStateInSkill()) // SmbManager.SetState(battleCharacter.m_kAnimator, battleCharacter.IsNoMove ? PlayerState.Idle : PlayerState.Move); // m_ePlayState은 바꾸지 않고 하체 animation 만 바꿈 // else // battleCharacter.SetActionState(PlayerState.Move); // } //} //UiJoyStick.ResetGameOverCount(); }