Пример #1
0
 void OnActionStart(PEActionType actionType)
 {
     if (actionType == PEActionType.Fell)
     {
         PeCamera.fpCameraCanRotate = false;
     }
 }
Пример #2
0
 void OnActionEnd(PEActionType actionType)
 {
     if (actionType == PEActionType.Fell)
     {
         PeCamera.fpCameraCanRotate = true;
     }
 }
Пример #3
0
 public void EndAction(PEActionType type)
 {
     if (m_Motion != null)
     {
         m_Motion.EndAction(type);
     }
 }
Пример #4
0
 public void DoActionImmediately(PEActionType type, PEActionParam para = null)
 {
     if (HasAction(type))
     {
         if (IsActionRunning(type))
         {
             m_ActionDic[(int)type].ResetAction(para);
         }
         else
         {
             if (null != m_SkEntity._net)
             {
                 ((SkNetworkInterface)m_SkEntity._net).SendDoAction(type, para);
             }
             ActionRelationData data = ActionRelationData.GetData(type);
             if (null != onActionStart)
             {
                 onActionStart(type);
             }
             RunningAction runningAction = GetRunningAction();
             runningAction.Do(m_ActionDic[(int)type], data, para, true);
             m_RunningAction[(int)type] = runningAction;
         }
     }
 }
Пример #5
0
 public void OnActionEnd(PEActionType type)
 {
     if (null != onActionEnd)
     {
         onActionEnd(type);
     }
 }
Пример #6
0
 public void RemoveAction(PEActionType type)
 {
     if (HasAction(type))
     {
         EndImmediately(type);
         m_ActionDic[(int)type] = null;
     }
 }
Пример #7
0
 public bool DoAction(PEActionType type, PEActionParam para)
 {
     if (m_Motion != null)
     {
         return(m_Motion.DoAction(type, para));
     }
     return(false);
 }
Пример #8
0
    private void RPC_SKDANO(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        PEActionType proType = stream.Read <PEActionType> ();

        if (MtCmpt != null)
        {
            MtCmpt.DoActionImmediately((PEActionType)proType);
        }
    }
Пример #9
0
 public static ActionRelationData GetData(PEActionType type)
 {
     if (null == m_Relations)
     {
         Debug.LogError("ActionRelationData not init");
         return(null);
     }
     return(m_Relations[(int)type]);
 }
Пример #10
0
 public void ContinueAction(PEActionType beType, PEActionType tryPauseType)
 {
     if (HasAction(beType))
     {
         m_ActionDic[(int)beType].m_PauseActions.Remove(tryPauseType);
         if (IsActionRunning(beType) && !m_ActionDic[(int)beType].pauseAction)
         {
             m_ActionDic[(int)beType].ContinueAction();
         }
     }
 }
Пример #11
0
    private void RPC_SKDAN(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        PEActionType   proType = stream.Read <PEActionType> ();
        PEActionParamN param   = PEActionParamN.param;

        param.n = stream.Read <int> ();
        if (MtCmpt != null)
        {
            MtCmpt.DoActionImmediately((PEActionType)proType, param);
        }
    }
Пример #12
0
 public void SendDoAction(PEActionType type, PEActionParam obj)
 {
     if (!hasOwnerAuth)
     {
         return;
     }
     if (SendActionEvent.ContainsKey(type))
     {
         SendActionEvent [type] (type, obj);
     }
 }
Пример #13
0
 public void SendEndImmediately(PEActionType type)
 {
     if (!hasOwnerAuth)
     {
         return;
     }
     if (SendActionEvent.ContainsKey(type))
     {
         RPCServer(EPacketType.PT_InGame_SKDAEndImmediately, type);
     }
 }
Пример #14
0
 void OnActionEnd(PEActionType type)
 {
     if (null != Weapon)
     {
         PEHoldAbleEquipment equipment = m_Weapon as PEHoldAbleEquipment;
         if (null != equipment && equipment.m_HandChangeAttr.m_ActiveActionType == type)
         {
             m_Weapon   = null;
             m_WeaponID = -1;
         }
     }
 }
Пример #15
0
    private void RPC_SKDAVQ(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        PEActionType    proType = stream.Read <PEActionType> ();
        PEActionParamVQ param   = PEActionParamVQ.param;

        param.vec = stream.Read <Vector3> ();
        param.q   = stream.Read <Quaternion> ();
        if (MtCmpt != null)
        {
            MtCmpt.DoActionImmediately((PEActionType)proType, param);
        }
    }
Пример #16
0
    private void RPC_SKDAVVF(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        PEActionType     proType = stream.Read <PEActionType> ();
        PEActionParamVVF param   = PEActionParamVVF.param;

        param.vec1 = stream.Read <Vector3> ();
        param.vec2 = stream.Read <Vector3> ();
        param.f    = stream.Read <float> ();
        if (MtCmpt != null)
        {
            MtCmpt.DoActionImmediately((PEActionType)proType, param);
        }
    }
Пример #17
0
 public void PauseAction(PEActionType beType, PEActionType tryPauseType)
 {
     if (HasAction(beType))
     {
         if (IsActionRunning(beType) && !m_ActionDic[(int)beType].pauseAction)
         {
             m_ActionDic[(int)beType].PauseAction();
         }
         if (!m_ActionDic[(int)beType].m_PauseActions.Contains(tryPauseType))
         {
             m_ActionDic[(int)beType].m_PauseActions.Add(tryPauseType);
         }
     }
 }
Пример #18
0
 public bool EndAction(PEActionType type)
 {
     if (IsActionRunning(type))
     {
         m_ActionDic[(int)type].EndAction();
         //send stop action
         if (null != m_SkEntity._net && type != PEActionType.Wentfly && type != PEActionType.Knocked)
         {
             ((SkNetworkInterface)m_SkEntity._net).SendEndAction(type);
         }
         return(true);
     }
     return(false);
 }
Пример #19
0
 public bool CanDoAction(PEActionType type, PEActionParam para = null)
 {
     if (HasAction(type))
     {
         if (IsActionRunning(type))
         {
             return(true);
         }
         else if (m_ActionDic[(int)type].CanDoAction(para))
         {
             ActionRelationData data = ActionRelationData.GetData(type);
             return(CheckDepend(data));
         }
     }
     return(false);
 }
Пример #20
0
 public bool EndImmediately(PEActionType type)
 {
     if (IsActionRunning(type))
     {
         m_RunningActionPool.Push(m_RunningAction[(int)type]);
         m_RunningAction[(int)type].EndAction();
         m_RunningAction[(int)type] = null;
         //send stop action
         if (null != m_SkEntity._net && type != PEActionType.Wentfly && type != PEActionType.Knocked)
         {
             ((SkNetworkInterface)m_SkEntity._net).SendEndImmediately(type);
         }
         OnActionEnd(type);
         return(true);
     }
     return(false);
 }
Пример #21
0
        public bool DoAction(PEActionType type, PEActionParam para = null)
        {
            if (HasAction(type))
            {
                if (IsActionRunning(type))
                {
//					if(null != m_SkEntity._net)
//						((SkNetworkInterface)m_SkEntity._net).SendDoAction(type,para);
                    m_ActionDic[(int)type].ResetAction(para);
                    return(true);
                }
                else if (m_ActionDic[(int)type].CanDoAction(para))
                {
                    ActionRelationData data = ActionRelationData.GetData(type);
                    if (null == data)
                    {
                        return(false);
                    }

                    if (CheckDepend(data))
                    {
                        if (null != m_SkEntity._net)
                        {
                            ((SkNetworkInterface)m_SkEntity._net).SendDoAction(type, para);
                        }

                        if (null != onActionStart)
                        {
                            onActionStart(type);
                        }
                        RunningAction runningAction = GetRunningAction();
                        runningAction.Do(m_ActionDic[(int)type], data, para, false);
                        m_RunningAction[(int)type] = runningAction;
                                                #if UNITY_EDITOR
                        if (ShowLog)
                        {
                            Debug.LogError("DoAction: " + type.ToString());
                        }
                                                #endif
                        return(true);
                    }
                }
            }
            return(false);
        }
Пример #22
0
    private void RPC_SKDAVQSNS(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        PEActionType       proType = stream.Read <PEActionType>();
        PEActionParamVQSNS param   = PEActionParamVQSNS.param;

        param.vec      = stream.Read <Vector3>();
        param.q        = stream.Read <Quaternion>();
        param.strAnima = stream.Read <string>();
        param.enitytID = stream.Read <int>();
        param.boneStr  = stream.Read <string>();

        PeEntity player = EntityMgr.Instance.Get(Id);

        //2017.02.17 我可以看见这个玩家的时候再执行行为
        if (null != player && player.hasView)
        {
            if (MtCmpt != null)
            {
                MtCmpt.DoActionImmediately((PEActionType)proType, param);
            }
        }
    }
Пример #23
0
 private void SendSKDATwoHandSwordPutOff(PEActionType type, PEActionParam obj)
 {
     RPCServer(EPacketType.PT_InGame_SKDANO, type);
 }
Пример #24
0
    private void SendSKDAOperation(PEActionType type, PEActionParam obj)
    {
        PEActionParamVQS param = obj as PEActionParamVQS;

        RPCServer(EPacketType.PT_InGame_SKDAVQS, type, param.vec, param.q, param.str);
    }
Пример #25
0
    private void SendSKDASit(PEActionType type, PEActionParam obj)
    {
        PEActionParamVQSN param = obj as PEActionParamVQSN;

        RPCServer(EPacketType.PT_InGame_SKDAVQSN, type, param.vec, param.q, param.str, param.n);
    }
Пример #26
0
    private void SendSKDATwoHandSwordAttack(PEActionType type, PEActionParam obj)
    {
        PEActionParamVVNN param = obj as PEActionParamVVNN;

        RPCServer(EPacketType.PT_InGame_SKDAVVNN, type, param.vec1, param.vec2, param.n1, param.n2);
    }
Пример #27
0
    private void SendSKDARide(PEActionType type, PEActionParam obj)
    {
        PEActionParamVQSNS paramVQSNS = obj as PEActionParamVQSNS;

        RPCServer(EPacketType.PT_InGame_SKDAVQSNS, type, paramVQSNS.vec, paramVQSNS.q, paramVQSNS.strAnima, paramVQSNS.enitytID, paramVQSNS.boneStr);
    }
Пример #28
0
 private void SendSKDAAlienDeath(PEActionType type, PEActionParam obj)
 {
     RPCServer(EPacketType.PT_InGame_SKDANO, type);
 }
Пример #29
0
    private void SendSKDATalk(PEActionType type, PEActionParam obj)
    {
        PEActionParamS param = obj as PEActionParamS;

        RPCServer(EPacketType.PT_InGame_SKDAS, type, param.str);
    }
Пример #30
0
    private void SendSKDACure(PEActionType type, PEActionParam obj)
    {
        PEActionParamVFVFS param = obj as PEActionParamVFVFS;

        RPCServer(EPacketType.PT_InGame_SKDAVFVFS, type, param.vec1, param.f1, param.vec2, param.f2, param.str);
    }