コード例 #1
0
        public void AddBuff(BuffData buffData, ActorObj TargetObj)
        {
            if (TargetObj != null)
            {
                //区分目标
                LuaTable desc = ConfigManager.Instance.Skill.GetBuffConfig(buffData.buffType);
                if (desc != null)
                {
                    if (TargetObj.GetBuff(buffData.BufferInstanceID) != null)
                    {
                        //Debug.LogError("重复BUFF  " + buffData.BufferInstanceID + "   " + buffData.buffType);
                        return;
                    }
                    TargetObj.Addbuff(buffData, TargetObj);

                    //  buffList.Add(buffData.BufferInstanceID, TargetObj);

                    buffList[buffData.BufferInstanceID] = TargetObj;
                    if (TargetObj.ServerID == CoreEntry.gActorMgr.MainPlayer.ServerID)
                    {
                        EventParameter msg = new EventParameter();
                        msg.longParameter = buffData.buffType;
                        // Debug.LogError("添加BUFF  " + buffData.BufferInstanceID + "   " + buffData.buffType);
                        CoreEntry.gEventMgr.TriggerEvent(GameEvent.GE_CC_ADDBUFF, msg);
                    }
                }
            }
        }