void RemovePositionModifier(EffectModifier fxMod) { try { EffectPositionModifier posMod = (EffectPositionModifier)fxMod; if (posMod != null) { foreach (EffectPositionIntegrator integrator in positionIntegrators) { // If already exists as a handled modifier, don't touch me if (integrator.handledModifiers.Contains(posMod)) { integrator.RemoveModifier(posMod); return; } } } } catch (InvalidCastException e) { } }
void RemoveLightColorModifier(EffectModifier fxMod) { try { EffectLightColorModifier mod = (EffectLightColorModifier)fxMod; if (mod != null) { foreach (EffectLightColorIntegrator integrator in lightColorIntegrators) { // If already exists as a handled modifier, don't touch me if (integrator.handledModifiers.Contains(mod)) { integrator.RemoveModifier(mod); return; } } } } catch (InvalidCastException e) { } }
void RemoveFloatModifier(EffectModifier fxMod) { try { EffectFloatModifier floatMod = (EffectFloatModifier)fxMod; if (floatMod != null) { foreach (EffectFloatIntegrator floatInt in floatIntegrators) { // If already exists as a handled modifier, don't touch me if (floatInt.handledModifiers.Contains(floatMod)) { floatInt.RemoveModifier(floatMod); return; } } } } catch (InvalidCastException e) { } }
void ParseLightColorModifier(EffectModifier fxMod) { try { EffectLightColorModifier colorMod = (EffectLightColorModifier)fxMod; if (colorMod != null) { bool needsNewIntegrator = true; EffectLightColorIntegrator targetIntegrator = null; foreach (EffectLightColorIntegrator integrator in lightColorIntegrators) { // If already exists as a handled modifier, don't touch me if (integrator.handledModifiers.Contains(colorMod)) { return; } // if there's already an integrator that has the transform name and float name, don't need to add if (integrator.colorName == colorMod.colorName && integrator.transformName == colorMod.transformName) { targetIntegrator = integrator; needsNewIntegrator = false; } } if (needsNewIntegrator && colorMod.colorName != "") { EffectLightColorIntegrator newIntegrator = new EffectLightColorIntegrator(this, colorMod); lightColorIntegrators.Add(newIntegrator); } else if (!needsNewIntegrator && colorMod.colorName != "") { if (targetIntegrator != null) { targetIntegrator.AddModifier(colorMod); } } } } catch (InvalidCastException e) { } }
void ParseFloatModifier(EffectModifier fxMod) { try { EffectFloatModifier floatMod = (EffectFloatModifier)fxMod; if (floatMod != null) { bool needsNewIntegrator = true; EffectFloatIntegrator targetIntegrator = null; foreach (EffectFloatIntegrator floatInt in floatIntegrators) { // If already exists as a handled modifier, don't touch me if (floatInt.handledModifiers.Contains(floatMod)) { return; } // if there's already an integrator that has the transform name and float name, don't need to add if (floatInt.floatName == floatMod.floatName && floatInt.transformName == floatMod.transformName) { targetIntegrator = floatInt; needsNewIntegrator = false; } } if (needsNewIntegrator && floatMod.floatName != "") { EffectFloatIntegrator newIntegrator = new EffectFloatIntegrator(this, floatMod); floatIntegrators.Add(newIntegrator); } else if (!needsNewIntegrator && floatMod.floatName != "") { if (targetIntegrator != null) { targetIntegrator.AddModifier(floatMod); } } } } catch (InvalidCastException e) { } }
public void ModifierParameterChange(EffectModifier mod) { RemoveModifier(mod); AddModifier(mod); }
public void AddModifier(EffectModifier mod) { mod.Init(this); fxModifiers.Add(mod); }
public void RemoveModifier(EffectModifier mod) { fxModifiers.Remove(mod); }