public static CHumanState_Dash Instance() { if (instance == null) { instance = new CHumanState_Dash(); } return(instance); }
void FindBody() { if (m_human.Find.GetComponent <CFind>().FindBodyFlag == true) { if (m_human.PStateMachine.CurrentState() != CHumanState_Dash.Instance() && m_human.ItemFlag == false) { if (Input.GetKey(KeyCode.C)) { m_human.PStateMachine.ChangeState(CHumanState_Carry.Instance(), m_human.PStateMachine.CurrentState().IsEnd); keyIn = 1; } } } else { if (m_human.PStateMachine.CurrentState() == CHumanState_Carry.Instance() || m_human.PStateMachine.CurrentState() == CHumanState_Carry_Motion.Instance()) { m_human.PStateMachine.ChangeState(CHumanState_Main.Instance(), m_human.PStateMachine.CurrentState().IsEnd); } } }
void move(int type) { float x = Input.GetAxisRaw("Horizontal"); float z = Input.GetAxisRaw("Vertical"); Vector3 tmp = new Vector3(x, 0, z); m_human.MoveDirection = tmp; m_human.MoveDirection.Normalize(); if (m_human.CarryFlag != true) { if (type == 2 && m_human.HunmanStrength > 0) { m_human.PStateMachine.ChangeState(CHumanState_Dash.Instance(), m_human.PStateMachine.CurrentState().IsEnd); } else { m_human.PStateMachine.ChangeState(CHumanState_Move.Instance(), m_human.PStateMachine.CurrentState().IsEnd); } } }