/// <summary> /// Creates a <see cref="ParticleEffect"/> at a position that runs looped. /// </summary> /// <param name="effectName">The name of the effect.</param> /// <param name="pos">The World position where the effect is.</param> /// <param name="rot">What rotation to apply to the effect.</param> /// <param name="scale">How much to scale the size of the effect by.</param> /// <param name="invertAxis">Which axis to flip the effect in.</param> /// <param name="startNow">if <c>true</c> attempt to start this effect now; otherwise, the effect will start when <see cref="ParticleEffect.Start"/> is called.</param> /// <returns>The <see cref="CoordinateParticleEffect"/> represented by this that can be used to start/stop/modify this effect</returns> public CoordinateParticleEffect CreateEffectAtCoord(string effectName, Vector3 pos, Vector3 rot = default(Vector3), float scale = 1.0f, InvertAxis invertAxis = InvertAxis.None, bool startNow = false) { var result = new CoordinateParticleEffect(this, effectName, pos) { Rotation = rot, Scale = scale, InvertAxis = invertAxis }; if (startNow) { result.Start(); } return(result); }
/// <summary> /// Creates a copy of this <see cref="CoordinateParticleEffect"/> to another position to simplify applying the same effect to many positions. /// </summary> /// <param name="position">The position to copy to.</param> /// <returns>A <see cref="CoordinateParticleEffect"/> that has all the same properties as this instance, but for a different position.</returns> public CoordinateParticleEffect CopyTo(Vector3 position) { var result = new CoordinateParticleEffect(_asset, _effectName, position) { Rotation = _rotation, Color = _color, Scale = _scale, Range = _range, InvertAxis = _InvertAxis }; if (IsActive) { result.Start(); } return(result); }