Exemple #1
0
        public void OnMessage(CPlayer type, EventMessageBase data)
        {
            if (data.eventMessageAction == (int)EnitityCommon.EnitityAction.ENITITY_ACTION_MOVETOP)
            {
                type.GetRenderObject().transform.Translate(Vector3.forward * CPlayerCommon.Player_Speed * 0.015f);
            }
            else if (data.eventMessageAction == (int)EnitityCommon.EnitityAction.ENITITY_ACTION_MOVEBOTTOM)
            {
                type.GetRenderObject().transform.Translate(Vector3.back * CPlayerCommon.Player_Speed * 0.015f);
            }
            else if (data.eventMessageAction == (int)EnitityCommon.EnitityAction.ENITITY_ACTION_MOVELEFT)
            {
                Vector3 angle = new Vector3(0, -1, 0);
                type.GetRenderObject().transform.eulerAngles += angle;
            }
            else if (data.eventMessageAction == (int)EnitityCommon.EnitityAction.ENITITY_ACTION_MOVERIGHT)
            {
                Vector3 angle = new Vector3(0, 1, 0);
                type.GetRenderObject().transform.eulerAngles += angle;
            }
            else if (data.eventMessageAction == (int)EnitityCommon.EnitityAction.ENITITY_ACTION_MOVEOVER)
            {
                type.m_stateMachine.ChangeState(PlayerIdelState.GetInstance());
            }

            //type.m_stateMachine.ChangeState (PlayerIdelState.GetInstance ());
        }
Exemple #2
0
 public static PlayerIdelState GetInstance()
 {
     if (instance == null)
     {
         instance = new PlayerIdelState();
     }
     return(instance);
 }