//==========================处理网络数据开始=============================================================
    public override void PlayerInputHandle(PB_ClientInput input)
    {
        InputType iInputType = input.InputType;

        switch (iInputType)
        {
        case InputType.MoveStart:
            PlayerInputHandle_MoveStart();
            break;

        case InputType.MoveAngle:
            PlayerInputHandle_MoveAngle(input.AngleX, input.AngleY);
            break;

        case InputType.MoveEnd:
            PlayerInputHandle_MoveEnd();
            break;

        case InputType.KeyUp:
            PlayerInputHandle_KeyUp(input.Key, input.TargetID);
            break;

        case InputType.KeyDown:
            PlayerInputHandle_KeyDown(input.Key, input.TargetID);
            break;

        case InputType.KeyAngle:
            PlayerInputHandle_KeyAngle(input.Key, input.AngleX, input.AngleY);
            break;

        case InputType.ClickXy:
            PlayerInputHandle_ClickXY(input.PosX, input.PosY);
            break;
        }
    }
Beispiel #2
0
    public void SendEndMove()
    {
        PB_C2SClientInput mClientInputs = new PB_C2SClientInput();
        PB_ClientInput    oneInput      = new PB_ClientInput();

        oneInput.InputType = InputType.MoveEnd;
        mClientInputs.Inputs.Add(oneInput);
        _UnityUdpSocket.Send(MsgID.C2SInputInfo, mClientInputs);
        //Debug.Log("SendEndMove=====");
    }
Beispiel #3
0
    public void SendAngleSkill(int inputKey, int tAngle_X, int tAngle_Y)
    {
        PB_C2SClientInput mClientInputs = new PB_C2SClientInput();
        PB_ClientInput    oneInput      = new PB_ClientInput();

        oneInput.InputType = InputType.KeyAngle;
        oneInput.Key       = inputKey;
        oneInput.AngleX    = tAngle_X;
        oneInput.AngleY    = tAngle_Y;
        mClientInputs.Inputs.Add(oneInput);
        _UnityUdpSocket.Send(MsgID.C2SInputInfo, mClientInputs);
    }
Beispiel #4
0
    public void SendInputSkill(int inputKey, InputType inputType, int TargetID)
    {
        PB_C2SClientInput mClientInputs = new PB_C2SClientInput();
        PB_ClientInput    oneInput      = new PB_ClientInput();

        oneInput.InputType = inputType;
        oneInput.Key       = inputKey;
        oneInput.TargetID  = TargetID;
        mClientInputs.Inputs.Add(oneInput);
        _UnityUdpSocket.Send(MsgID.C2SInputInfo, mClientInputs);
        //Debug.Log("SendSkill_1=====");
    }
Beispiel #5
0
 public void SendChangeAngle(int tAngle_X, int tAngle_Y)
 {
     mLsatChangeDirTime += Time.deltaTime;
     if (mLsatChangeDirTime > _ChangeDirIntervalTime)
     {
         PB_ClientInput oneInput = new PB_ClientInput();
         oneInput.InputType = InputType.MoveAngle;
         oneInput.AngleX    = tAngle_X;
         oneInput.AngleY    = tAngle_Y;
         ChangeDirInputs.Inputs.Add(oneInput);
         _UnityUdpSocket.Send(MsgID.C2SInputInfo, ChangeDirInputs);
         //Debug.Log("SendChangeDir=======" + tAngle);
         ChangeDirInputs    = new PB_C2SClientInput();
         mLsatChangeDirTime = 0;
     }
     else
     {
         PB_ClientInput oneInput = new PB_ClientInput();
         oneInput.InputType = InputType.MoveAngle;
         oneInput.AngleX    = tAngle_X;
         oneInput.AngleY    = tAngle_Y;
         ChangeDirInputs.Inputs.Add(oneInput);
     }
 }
Beispiel #6
0
 public abstract void PlayerInputHandle(PB_ClientInput input);