public BuffEfectEntityData(int entityId, int typeId, string point, int ownerId, BaseBuffHandler baseBuffHandler) : base(entityId, typeId) { m_Point = point; m_OwnerId = ownerId; m_BaseBuffHandler = baseBuffHandler; }
public void RemoveBuff(int buffId) { BaseBuffHandler baseBuffHandler = null; if (Buffs.TryGetValue(buffId, out baseBuffHandler)) { if (baseBuffHandler is IBuffRemoveHanlder) { IBuffRemoveHanlder removeHanlder = (IBuffRemoveHanlder)baseBuffHandler; removeHanlder.Remove(baseBuffHandler.BuffHandlerVar); } Buffs.Remove(buffId); } }
/// <summary> /// 显示Buff特效 /// </summary> /// <param name="entityComponent"></param> /// <param name="effectname"></param> /// <param name="owner"></param> /// <param name="point"></param> public static void ShowBuffEffect(this EntityComponent entityComponent, string effectname, int ownerId, string point, BaseBuffHandler baseBuffHandler) { int entityId = entityComponent.GenerateSerialId(); entityComponent.ShowEntity(entityId, typeof(BuffEfectEntity), AssetUtility.GetBuffEffectAsset(effectname), "Effect", Constant.AssetPriority.EffectAsset, new BuffEfectEntityData(entityId, ownerId, point, ownerId, baseBuffHandler)); }