Beispiel #1
0
    public override void SetAimState(bool aimState)
    {
        m_AimState = aimState;
        if (m_AimState)
        {
            m_MotionMgr.ContinueAction(m_HandChangeAttr.m_ActiveActionType, m_HandChangeAttr.m_ActiveActionType);
        }
        else
        {
            m_MotionMgr.PauseAction(m_HandChangeAttr.m_ActiveActionType, m_HandChangeAttr.m_ActiveActionType);
        }

        if (null != m_Anim && "" != m_AimAnim)
        {
            m_Anim.SetBool(m_AimAnim, aimState);
            if (PeGameMgr.IsMulti && null != m_Entity.netCmpt && !m_Entity.netCmpt.network.hasOwnerAuth)
            {
                AiNetwork aiNetWork = m_Entity.netCmpt.network as AiNetwork;
                if (null != aiNetWork)
                {
                    aiNetWork.RequestSetBool(Animator.StringToHash(m_AimAnim), aimState);
                }
            }
        }
    }
Beispiel #2
0
    public static void OnMonsterAdd(int id, AiNetwork ai, Pathea.PeEntity entity)
    {
        EntityMonsterBeacon mbEntity = Pathea.EntityMgr.Instance.Get(id) as EntityMonsterBeacon;

        if (null != mbEntity)
        {
            mbEntity.OnMonsterCreated(entity);
        }
        else
        {
            if (null != entity)
            {
                Pathea.CommonCmpt cc = entity.GetCmpt <Pathea.CommonCmpt>();
                if (cc != null)
                {
                    AiTowerDefense td = AiTowerDefense.Get <AiTowerDefense>(id);
                    if (null != td)
                    {
                        cc.TDpos = td._pos;
                    }
                }

                Pathea.SkAliveEntity sae = entity.GetCmpt <Pathea.SkAliveEntity>();
                if (sae != null)
                {
                    sae.SetAttribute(Pathea.AttribType.DefaultPlayerID, 8);
                    sae.SetAttribute(Pathea.AttribType.CampID, 26);
                }
            }
        }
    }
Beispiel #3
0
    void RPC_S2C_GetDeadObjItem(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        int netId  = stream.Read <int>();
        int index  = stream.Read <int>();
        int itemId = stream.Read <int>();

        AiNetwork ai = AiNetwork.Get <AiNetwork>(netId);

        if (null == ai || null == ai.Runner)
        {
            return;
        }

        ItemDropPeEntity dropEntity = ai.Runner.GetComponent <ItemDropPeEntity>();

        if (null == dropEntity)
        {
            return;
        }

        ItemSample item = dropEntity.Get(index);

        if (null == item || item.protoId != itemId)
        {
            return;
        }

        dropEntity.RemoveDroppableItem(item);

        if (null != GameUI.Instance.mItemGet)
        {
            GameUI.Instance.mItemGet.Reflash();
        }
    }
Beispiel #4
0
    void RPC_S2C_GetDeadObjAllItems(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        int netId = stream.Read <int>();

        AiNetwork ai = AiNetwork.Get <AiNetwork>(netId);

        if (null == ai || null == ai.Runner)
        {
            return;
        }

        ItemDropPeEntity dropEntity = ai.Runner.GetComponent <ItemDropPeEntity>();

        if (null == dropEntity)
        {
            return;
        }

        dropEntity.RemoveDroppableItemAll();

        if (null != GameUI.Instance.mItemGet)
        {
            GameUI.Instance.mItemGet.Reflash();
        }
    }
    public static void OnMonsterAdd(int id, AiNetwork ai, Pathea.PeEntity entity)
    {
        EntityGrp grpEntity = Pathea.EntityMgr.Instance.Get(id) as EntityGrp;

        if (null != grpEntity)
        {
            grpEntity.OnMemberCreated(entity);
        }
    }
    void DelAiObj(AiNetwork ai)
    {
        if (null == ai)
        {
            return;
        }

        if (_aiList.Contains(ai))
        {
            _aiList.Remove(ai);
        }
    }
    void AddAiObj(AiNetwork ai)
    {
        if (null == ai)
        {
            return;
        }

        if (!_aiList.Contains(ai))
        {
            _aiList.Add(ai);
        }
    }