public static CGhostState_Move Instance() { if (instance == null) { instance = new CGhostState_Move(); } return(instance); }
void UpdateServer() { switch (m_status) { case (int)GhostStateID.MAIN: m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Main.Instance()); break; case (int)GhostStateID.ATK: m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Atk.Instance()); break; case (int)GhostStateID.AVATAR: m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Avatar.Instance()); break; case (int)GhostStateID.DASH: m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Dash.Instance()); break; case (int)GhostStateID.MOVE: m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Move.Instance()); break; case (int)GhostStateID.SLOW: m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Slow.Instance()); break; case (int)GhostStateID.STAN: m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Stan.Instance()); break; case (int)GhostStateID.WAIT: m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Wait.Instance()); break; } }
void Move() { float x = Input.GetAxisRaw("Horizontal"); float z = Input.GetAxisRaw("Vertical"); // 移動する向きを求める Vector3 tmp = new Vector3(x, 0, z); m_ghostMain.MoveDirection = tmp.normalized; if (m_ghostMain.MoveDirection.magnitude > 0.1f) { if (!CInputComponent.InputAction(CInputComponent.KEY_ACTION.PRESS, KeyCode.LeftShift, Dash)) { m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Move.Instance(), m_ghostMain.m_pStateMachine.CurrentState().IsEnd); } return; } m_ghostMain.m_pStateMachine.ChangeState(CGhostState_Main.Instance(), m_ghostMain.m_pStateMachine.CurrentState().IsEnd); }