public static E[] FindEffects <E>(VisualEffectName handle, EffectResource resource) where E : Effect { VisualEffectType eType = GetEffectType <E>(); byte bType = (byte)eType; List <E> effects = new List <E>(); EffectResource.EffectSection effectSection = FindEffectSection(eType, resource); if (effectSection == null) { return(null); } VisualEffect visualEffect = FindVisualEffect(handle, resource); int indexCount = visualEffect.Descriptions.Count; VisualEffect.Description veIndex; for (int i = 0; i < indexCount; i++) { veIndex = visualEffect.Descriptions[i] as VisualEffect.Description; if (veIndex.ComponentType == bType) { effects.Add(effectSection.Items[veIndex.ComponentIndex] as E); } } return(effects.ToArray()); }
public static Effect FindEffect(VisualEffectType eType, int eIndex, EffectResource resource) { EffectResource.EffectSection eSection = FindEffectSection(eType, resource); if (eSection == null) { return(null); } return(eSection.Items[eIndex] as Effect); }
public EffectResource.EffectSection GetEffectSection(VisualEffectType eType) { int index = -1; for (int i = 0; i < sEffectSectionCount; i++) { if (eType == sEffectTypeList[i]) { index = i; break; } } return(this.mEffectSectionList[this.mEffectSectionIndices[index]]); }
public static EffectResource.EffectSection FindEffectSection(VisualEffectType eType, EffectResource resource) { int effectSectionCount = resource.EffectSections.Count; EffectResource.EffectSection eSection; for (int i = 0; i < effectSectionCount; i++) { eSection = resource.EffectSections[i]; if (eSection.Type == (ushort)eType) { return(eSection); } } return(null); }
public Effect GetEffect(VisualEffectType eType, int eIndex) { EffectResource.EffectSection section = GetEffectSection(eType); return(section.Items[eIndex] as Effect); }
public EffectBuilder(VisualEffectType eType, int eIndex, Effect effect) { this.EffectType = eType; this.mEffectIndex = eIndex; this.Effect = effect; }
public EffectBuilder(VisualEffectType eType, int eIndex) { this.EffectType = eType; this.mEffectIndex = eIndex; }
// Apply a looping visualeffect to target that only player can see // visualeffect: VFX_DUR_*, call again to remove an applied effect // -1 to remove all effects // // Note: Only really works with looping effects: VFX_DUR_* // Other types *kind* of work, they'll play when reentering the area and the object is in view // or when they come back in view range. public static void ApplyLoopingVisualEffectToObject(uint player, uint target, VisualEffectType visualEffect) { Internal.NativeFunctions.nwnxSetFunction(PLUGIN_NAME, "ApplyLoopingVisualEffectToObject"); Internal.NativeFunctions.nwnxPushInt(visualEffect.InternalValue); Internal.NativeFunctions.nwnxPushObject(target); Internal.NativeFunctions.nwnxPushObject(player); Internal.NativeFunctions.nwnxCallFunction(); }