Ejemplo n.º 1
0
    public override void ProccessEvent(MsgBase msg)
    {
        switch (msg.msgId)
        {
        case (ushort)CharactorEvent.eIdle:
            m_animator.SetInteger("index", 0);
            Debug.Log("动画进入了待机状态!");
            break;

        case (ushort)CharactorEvent.eRun:
            MsgFloat tmpMsg = (MsgFloat)msg;
            Debug.Log("动画进入了跑的状态!" + tmpMsg.value);
            m_animator.SetFloat("Speed", tmpMsg.value);
            m_animator.SetInteger("index", 3);
            break;

        case (ushort)CharactorEvent.eAttack:
            break;

        case (ushort)CharactorEvent.eAttackBig:
            break;

        case (ushort)CharactorEvent.eJump:
            break;

        case (ushort)CharactorEvent.eJoyStick:
            break;

        case (ushort)CharactorEvent.eDie:
            break;

        default:
            break;
        }
    }
Ejemplo n.º 2
0
    public override void ProccessEvent(MsgBase Msg)
    {
        switch (Msg.msgId)
        {
        case (ushort)BloodEvent.eLooseBlood:
            MsgFloat tmpMsg = (MsgFloat)Msg;
            bloodCtr.SetBlood(tmpMsg.value);
            break;

        default:
            break;
        }
    }
Ejemplo n.º 3
0
    public override void ProccessEvent(MsgBase Msg)
    {
        switch (Msg.msgId)
        {
        case (ushort)CharactorEvent.eJoyStickBegin:
            controlMsg.ChangeEventId((ushort)CharactorEvent.eRun);
            controlMsg.value = tmpSpeed;
            SendMsg(controlMsg);
            break;

        case (ushort)CharactorEvent.eJoyStick:
            MsgVector2 tmpMsg = (MsgVector2)Msg;
            MoveCtr(tmpMsg.joyStick);

            controlMsg.ChangeEventId((ushort)CharactorEvent.eRun);
            controlMsg.value = tmpSpeed;
            SendMsg(controlMsg);

            break;

        case (ushort)CharactorEvent.eJoyStickEnd:
            controlMsg.ChangeEventId((ushort)CharactorEvent.eIdle);
            controlMsg.value = 0;
            SendMsg(controlMsg);
            break;

        case (ushort)CharactorEvent.eLooseBlood:
            MsgFloat bloodMsg = (MsgFloat)Msg;
            monsterData.ReduceBlood(bloodMsg.value);
            MsgFloat tmp = new MsgFloat((ushort)CharactorEvent.eLooseBlood, monsterData.GetBlood());
            SendMsg(tmp);
            break;

        default:
            break;
        }
    }
Ejemplo n.º 4
0
 private void Start()
 {
     controlMove = transform.GetComponent <CharacterController>();
     controlMsg  = new MsgFloat((ushort)CharactorEvent.eRun, 0);
     monsterData = new MonsterPlayerData();
 }