/// <summary> /// Creates a copy of this <see cref="EntityParticleEffect"/> to another <see cref="EntityBone"/> to simplify applying the same effect to many Entities. /// </summary> /// <param name="entityBone">The <see cref="EntityBone"/> to copy to.</param> /// <returns>An <see cref="EntityParticleEffect"/> that has all the same properties as this instance, but for a different <see cref="EntityBone"/>.</returns> public EntityParticleEffect CopyTo(EntityBone entityBone) { var result = new EntityParticleEffect(_asset, _effectName, entityBone) { Offset = _offset, Rotation = _rotation, Color = _color, Scale = _scale, Range = _range, InvertAxis = _InvertAxis }; if (IsActive) { result.Start(); } return(result); }
/// <summary> /// Creates a <see cref="ParticleEffect"/> on an <see cref="EntityBone"/> that runs looped. /// </summary> /// <param name="effectName">The name of the Effect</param> /// <param name="entityBone">The <see cref="EntityBone"/> the effect is attached to.</param> /// <param name="off">The offset from the <paramref name="entityBone"/> to attach the effect.</param> /// <param name="rot">The rotation, relative to the <paramref name="entityBone"/>, the effect has.</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. For a car side exahust you may need to flip in the Y Axis.</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="EntityParticleEffect"/> represented by this that can be used to start/stop/modify this effect</returns> public EntityParticleEffect CreateEffectOnEntity(string effectName, EntityBone entityBone, Vector3 off = default(Vector3), Vector3 rot = default(Vector3), float scale = 1.0f, InvertAxis invertAxis = InvertAxis.None, bool startNow = false) { var result = new EntityParticleEffect(this, effectName, entityBone) { Offset = off, Rotation = rot, Scale = scale, InvertAxis = invertAxis }; if (startNow) { result.Start(); } return(result); }