public WaterfallEffect(WaterfallEffect fx) { parentTemplate = fx.parentTemplate; TemplatePositionOffset = fx.TemplatePositionOffset; TemplateRotationOffset = fx.TemplateRotationOffset; TemplateScaleOffset = fx.TemplateScaleOffset; Load(fx.Save()); }
public override void Init(WaterfallEffect parentEffect) { base.Init(parentEffect); m = new Material[xforms.Count]; for (int i = 0; i < xforms.Count; i++) { m[i] = xforms[i].GetComponent <Renderer>().material; } }
public void CopyEffect(WaterfallEffect toCopy) { Utils.Log($"[ModuleWaterfallFX]: Copying effect {toCopy}", LogType.Modules); WaterfallEffect newEffect = new WaterfallEffect(toCopy); allFX.Add(newEffect); newEffect.InitializeEffect(this, false); }
public override void Init(WaterfallEffect parentEffect) { base.Init(parentEffect); l = new Light[xforms.Count]; for (int i = 0; i < xforms.Count; i++) { l[i] = xforms[i].GetComponent <Light>(); } }
public EffectLightFloatIntegrator(WaterfallEffect effect, EffectLightFloatModifier floatMod) { Utils.Log(String.Format("[EffectLightFloatIntegrator]: Initializing integrator for {0} on modifier {1}", effect.name, floatMod.fxName), LogType.Modifiers); xforms = new List <Transform>(); transformName = floatMod.transformName; parentEffect = effect; List <Transform> roots = parentEffect.GetModelTransforms(); foreach (Transform t in roots) { Transform t1 = t.FindDeepChild(transformName); if (t1 == null) { Utils.LogError(String.Format("[EffectLightFloatIntegrator]: Unable to find transform {0} on modifier {1}", transformName, floatMod.fxName)); } else { xforms.Add(t1); } } // float specific floatName = floatMod.floatName; handledModifiers = new List <EffectLightFloatModifier>(); handledModifiers.Add(floatMod); foreach (string nm in WaterfallConstants.ShaderPropertyHideFloatNames) { if (floatName == "Intensity") { testIntensity = true; } } initialFloatValues = new List <float>(); l = new Light[xforms.Count]; for (int i = 0; i < xforms.Count; i++) { l[i] = xforms[i].GetComponent <Light>(); if (floatName == "Intensity") { initialFloatValues.Add(l[i].intensity); } if (floatName == "Range") { initialFloatValues.Add(l[i].range); } if (floatName == "SpotAngle") { initialFloatValues.Add(l[i].spotAngle); } } }
public WaterfallEffect(WaterfallEffect fx, Vector3 positionOffset, Vector3 rotationOffset, Vector3 scaleOffset, string overrideTransformName) { TemplatePositionOffset = positionOffset; TemplateRotationOffset = rotationOffset; TemplateScaleOffset = scaleOffset; if (overrideTransformName != "") { fx.savedNode.SetValue("parentName", overrideTransformName, true); } Load(fx.savedNode); }
public override void Init(WaterfallEffect parentEffect) { base.Init(parentEffect); m = new Material[xforms.Count]; lights = new Light[xforms.Count]; lights = parentEffect.parentModule.GetComponentsInChildren <Light>().ToList().FindAll(x => x.transform.name == parentEffect.parentName).ToArray(); for (int i = 0; i < xforms.Count; i++) { m[i] = xforms[i].GetComponent <Renderer>().material; } }
public WaterfallEffect(WaterfallEffect fx, WaterfallEffectTemplate templateOwner) { parentTemplate = templateOwner; TemplatePositionOffset = parentTemplate.position; TemplateRotationOffset = parentTemplate.rotation; TemplateScaleOffset = parentTemplate.scale; if (parentTemplate.overrideParentTransform != "" && parentTemplate.overrideParentTransform != null) { fx.savedNode.SetValue("parentName", parentTemplate.overrideParentTransform, true); } Load(fx.savedNode); }
public EffectFloatIntegrator(WaterfallEffect effect, EffectFloatModifier floatMod) { Utils.Log(String.Format("[EffectFloatIntegrator]: Initializing integrator for {0} on modifier {1}", effect.name, floatMod.fxName), LogType.Modifiers); xforms = new(); transformName = floatMod.transformName; parentEffect = effect; var roots = parentEffect.GetModelTransforms(); foreach (var t in roots) { var t1 = t.FindDeepChild(transformName); if (t1 == null) { Utils.LogError(String.Format("[EffectFloatIntegrator]: Unable to find transform {0} on modifier {1}", transformName, floatMod.fxName)); } else { xforms.Add(t1); } } // float specific floatName = floatMod.floatName; handledModifiers = new(); handledModifiers.Add(floatMod); foreach (string nm in WaterfallConstants.ShaderPropertyHideFloatNames) { if (floatName == nm) { testIntensity = true; } } initialFloatValues = new(); m = new Material[xforms.Count]; r = new Renderer[xforms.Count]; for (int i = 0; i < xforms.Count; i++) { r[i] = xforms[i].GetComponent <Renderer>(); m[i] = r[i].material; initialFloatValues.Add(m[i].GetFloat(floatName)); } }
public void RemoveEffect(WaterfallEffect toRemove) { Utils.Log("[ModuleWaterfallFX]: Deleting effect", LogType.Modules); toRemove.CleanupEffect(this); if (toRemove.parentTemplate != null && Templates != null) { foreach (WaterfallEffectTemplate t in Templates) { if (t == toRemove.parentTemplate) { t.allFX.Remove(toRemove); } } } allFX.Remove(toRemove); }
public void AddEffect(WaterfallEffect newEffect) { Utils.Log("[ModuleWaterfallFX]: Added new effect", LogType.Modules); if (newEffect.parentTemplate != null && Templates != null) { foreach (WaterfallEffectTemplate t in Templates) { if (t == newEffect.parentTemplate) { t.allFX.Add(newEffect); } } } allFX.Add(newEffect); newEffect.InitializeEffect(this, true, useRelativeScaling); }
/// <summary> /// Initialize the effect /// </summary> public virtual void Init(WaterfallEffect effect) { parentEffect = effect; Utils.Log(String.Format("[EffectModifier]: Initializing modifier {0} ", fxName), LogType.Modifiers); List <Transform> roots = parentEffect.GetModelTransforms(); foreach (Transform t in roots) { Transform t1 = t.FindDeepChild(transformName); if (t1 == null) { Utils.LogError(String.Format("[EffectModifier]: Unable to find transform {0} on modifier {1}", transformName, fxName)); } else { xforms.Add(t1); } } }
public void CopyEffect(WaterfallEffect toCopy, WaterfallEffectTemplate template) { Utils.Log($"[ModuleWaterfallFX]: Copying effect {toCopy}", LogType.Modules); WaterfallEffect newEffect = new WaterfallEffect(toCopy); if (Templates != null && template != null) { foreach (WaterfallEffectTemplate t in Templates) { if (t == template) { t.allFX.Add(newEffect); } } } allFX.Add(newEffect); newEffect.InitializeEffect(this, false, useRelativeScaling); }
public EffectLightColorIntegrator(WaterfallEffect effect, EffectLightColorModifier floatMod) { Utils.Log(String.Format("[EffectLightColorIntegrator]: Initializing integrator for {0} on modifier {1}", effect.name, floatMod.fxName), LogType.Modifiers); xforms = new List <Transform>(); transformName = floatMod.transformName; parentEffect = effect; List <Transform> roots = parentEffect.GetModelTransforms(); foreach (Transform t in roots) { Transform t1 = t.FindDeepChild(transformName); if (t1 == null) { Utils.LogError(String.Format("[EffectLightColorIntegrator]: Unable to find transform {0} on modifier {1}", transformName, floatMod.fxName)); } else { xforms.Add(t1); } } // float specific colorName = floatMod.colorName; handledModifiers = new List <EffectLightColorModifier>(); handledModifiers.Add(floatMod); initialColorValues = new List <Color>(); l = new Light[xforms.Count]; for (int i = 0; i < xforms.Count; i++) { l[i] = xforms[i].GetComponent <Light>(); initialColorValues.Add(l[i].color); } }
public EffectColorIntegrator(WaterfallEffect effect, EffectColorModifier colorMod) { Utils.Log(String.Format("[EffectColorIntegrator]: Initializing integrator for {0} on modifier {1}", effect.name, colorMod.fxName), LogType.Modifiers); xforms = new(); transformName = colorMod.transformName; parentEffect = effect; var roots = parentEffect.GetModelTransforms(); foreach (var t in roots) { var t1 = t.FindDeepChild(transformName); if (t1 == null) { Utils.LogError(String.Format("[EffectColorIntegrator]: Unable to find transform {0} on modifier {1}", transformName, colorMod.fxName)); } else { xforms.Add(t1); } } // float specific colorName = colorMod.colorName; handledModifiers = new(); handledModifiers.Add(colorMod); initialColorValues = new(); m = new Material[xforms.Count]; for (int i = 0; i < xforms.Count; i++) { m[i] = xforms[i].GetComponent <Renderer>().material; initialColorValues.Add(m[i].GetColor(colorName)); } }
public void AddEffect(WaterfallEffect newEffect) { Utils.Log("[ModuleWaterfallFX]: Added new effect", LogType.Modules); allFX.Add(newEffect); newEffect.InitializeEffect(this, true); }
public override void Init(WaterfallEffect parentEffect) { base.Init(parentEffect); baseScale = xforms[0].localScale; }
public override void Init(WaterfallEffect parentEffect) { base.Init(parentEffect); baseRotation = xforms[0].localEulerAngles; }
public override void Init(WaterfallEffect parentEffect) { base.Init(parentEffect); basePosition = xforms[0].localPosition; }