private bool CalcMoveCommond() { if (m_KeyRecordList.Count > 0) { Vector3 moveSpeed = Vector3.zero; CommondKeyRecord KeyRecord = m_KeyRecordList[m_KeyRecordList.Count - 1]; if (KeyRecord.IsKeyDownOrHold(KeyCode.W)) { moveSpeed += transform.forward * m_MoveForwardSpeed; } if (KeyRecord.IsKeyDownOrHold(KeyCode.S)) { moveSpeed -= transform.forward * m_MoveBackSpeed; } if (KeyRecord.IsKeyDownOrHold(KeyCode.A)) { moveSpeed -= transform.right * m_MoveLeftSpeed; } if (KeyRecord.IsKeyDownOrHold(KeyCode.D)) { moveSpeed += transform.right * m_MoveBackSpeed; } m_ActionState = ACTION_STATE.MOVE_NORMAL; m_NormalMoveCmd.moveSpeed = moveSpeed; return(true); } m_ActionState = ACTION_STATE.IDLE; return(false); }
public bool IsKeyDownOrHold() { if (m_KeyRecordList.Count > 0) { CommondKeyRecord KeyRecord = m_KeyRecordList[m_KeyRecordList.Count]; if (KeyRecord.IsKeyDownOrHold(KeyCode.A) || KeyRecord.IsKeyDownOrHold(KeyCode.S) || KeyRecord.IsKeyDownOrHold(KeyCode.D) || KeyRecord.IsKeyDownOrHold(KeyCode.W)) { return(true); } } return(false); }