Esempio n. 1
0
    private void OnBuffAdd(KProtoBuf buf)
    {
        var msg = buf as S2C_ADD_BUFF_NOTIFY;

        SpacecraftEntity entity = m_GameplayProxy.GetEntityById <SpacecraftEntity>(msg.herID);

        if (entity != null)
        {
            AddBuffEvent buffEvent = new AddBuffEvent();
            buffEvent.buff = new BuffVO(msg.wBuffID, msg.byOverLap, Time.time, msg.nTime / 1000.0f, msg.link_id, msg.is_master != 0);
            m_EntityManager.SendEventToEntity(msg.herID, ComponentEventName.BuffAdd, buffEvent);

            MSAIBossProxy mSAI = GameFacade.Instance.RetrieveProxy(ProxyName.MSAIBossProxy) as MSAIBossProxy;
            mSAI.CheckBuffPlaySound(msg.wBuffID, true);
        }
    }
Esempio n. 2
0
    private void OnBuffRemove(KProtoBuf buf)
    {
        var msg = buf as S2C_DEL_BUFF_NOTIFY;

        SpacecraftEntity entity = m_GameplayProxy.GetEntityById <SpacecraftEntity>(msg.herID);

        if (entity != null)
        {
            RemoveBuffEvent buffEvent = new RemoveBuffEvent();
            buffEvent.buffID = msg.wBuffID;
            m_EntityManager.SendEventToEntity(msg.herID, ComponentEventName.BuffRemove, buffEvent);
        }

        MSAIBossProxy mSAI = GameFacade.Instance.RetrieveProxy(ProxyName.MSAIBossProxy) as MSAIBossProxy;

        mSAI.CheckBuffPlaySound(msg.wBuffID, false);
    }
        /// <summary>
        /// 删除buf
        /// </summary>
        private static void DisposeDeleteBuf(DeleteBuf result)
        {
            BaseEntity entity = GameplayManager.Instance.GetEntityManager().GetEntityById <BaseEntity>(result.HeroId);

            if (entity == null)
            {
                return;
            }

            Leyoutech.Utility.DebugUtility.LogWarning("广播", string.Format("删除buf  EntitId = {0}, BuffId = {1}", result.HeroId, result.BufId));


            RemoveBuffEvent buffEvent = new RemoveBuffEvent();

            buffEvent.buffID = result.BufId;
            entity.SendEvent(ComponentEventName.BuffRemove, buffEvent);

            MSAIBossProxy mSAI = GameFacade.Instance.RetrieveProxy(ProxyName.MSAIBossProxy) as MSAIBossProxy;

            mSAI.CheckBuffPlaySound(result.BufId, false);
        }
        /// <summary>
        /// 添加buf
        /// </summary>
        private static void DisposeAddBuf(AddBuf result)
        {
            BaseEntity entity = GameplayManager.Instance.GetEntityManager().GetEntityById <BaseEntity>(result.HeroId);

            if (entity == null)
            {
                return;
            }

            Leyoutech.Utility.DebugUtility.LogWarning("广播", string.Format("添加buf  EntitId = {0} , BuffId = {1}", result.HeroId, result.BufId));


            AddBuffEvent buffEvent = new AddBuffEvent();

            buffEvent.buff = new BuffVO(result.BufId, (int)result.Overlap, Time.time, result.Time / 1000.0f, result.LinkId, result.IsMaster);
            entity.SendEvent(ComponentEventName.BuffAdd, buffEvent);

            MSAIBossProxy mSAI = GameFacade.Instance.RetrieveProxy(ProxyName.MSAIBossProxy) as MSAIBossProxy;

            mSAI.CheckBuffPlaySound(result.BufId, true);
        }