public WaterfallEffect(string parent, WaterfallModel mdl) { parentName = parent; model = mdl; TemplatePositionOffset = Vector3.zero; TemplateRotationOffset = Vector3.zero; TemplateScaleOffset = Vector3.one; fxModifiers = new List <EffectModifier>(); }
public WaterfallEffect(string parent, WaterfallModel mdl, WaterfallEffectTemplate templateOwner) { parentName = parent; model = mdl; parentTemplate = templateOwner; TemplatePositionOffset = parentTemplate.position; TemplateRotationOffset = parentTemplate.rotation; TemplateScaleOffset = parentTemplate.scale; fxModifiers = new List <EffectModifier>(); }
/// <summary> /// Load the node from config /// </summary> /// <param name="node"></param> public void Load(ConfigNode node) { savedNode = node; node.TryGetValue("name", ref name); if (!node.TryGetValue("parentName", ref parentName)) { Utils.LogError(String.Format("[WaterfallEffect]: EFFECT with name {0} does not define parentName, which is required", name)); return; } model = new WaterfallModel(node.GetNode(WaterfallConstants.ModelNodeName)); fxModifiers = new List <EffectModifier>(); // types ConfigNode[] positionNodes = node.GetNodes(WaterfallConstants.PositionModifierNodeName); ConfigNode[] rotationNodes = node.GetNodes(WaterfallConstants.RotationModifierNodeName); ConfigNode[] scalingNodes = node.GetNodes(WaterfallConstants.ScaleModifierNodeName); ConfigNode[] colorNodes = node.GetNodes(WaterfallConstants.ColorModifierNodeName); ConfigNode[] uvOffsetNodes = node.GetNodes(WaterfallConstants.UVScrollModifierNodeName); ConfigNode[] floatNodes = node.GetNodes(WaterfallConstants.FloatModifierNodeName); foreach (ConfigNode subNode in positionNodes) { fxModifiers.Add(new EffectPositionModifier(subNode)); } foreach (ConfigNode subNode in rotationNodes) { fxModifiers.Add(new EffectRotationModifier(subNode)); } foreach (ConfigNode subNode in scalingNodes) { fxModifiers.Add(new EffectScaleModifier(subNode)); } foreach (ConfigNode subNode in colorNodes) { fxModifiers.Add(new EffectColorModifier(subNode)); } foreach (ConfigNode subNode in uvOffsetNodes) { fxModifiers.Add(new EffectUVScrollModifier(subNode)); } foreach (ConfigNode subNode in floatNodes) { fxModifiers.Add(new EffectFloatModifier(subNode)); } }