コード例 #1
0
        public EntityParticleEffect CreateEffectOnEntity(string effectName, EntityBone entityBone, Vector3 off = new Vector3(), Vector3 rot = new Vector3(), float scale = 1f, InvertAxis invertAxis = 0, bool startNow = false)
        {
            EntityParticleEffect effect1 = new EntityParticleEffect(this, effectName, entityBone);

            effect1.Offset     = off;
            effect1.Rotation   = rot;
            effect1.Scale      = scale;
            effect1.InvertAxis = invertAxis;
            EntityParticleEffect effect = effect1;

            if (startNow)
            {
                effect.Start();
            }
            return(effect);
        }
コード例 #2
0
        public EntityParticleEffect CopyTo(EntityBone entityBone)
        {
            EntityParticleEffect effect1 = new EntityParticleEffect(base._asset, base._effectName, entityBone);

            effect1.Offset     = base._offset;
            effect1.Rotation   = base._rotation;
            effect1.Color      = base._color;
            effect1.Scale      = base._scale;
            effect1.Range      = base._range;
            effect1.InvertAxis = base._InvertAxis;
            EntityParticleEffect effect = effect1;

            if (base.IsActive)
            {
                effect.Start();
            }
            return(effect);
        }
コード例 #3
0
        /// <summary>
        /// Creates a copy of this <see cref="EntityParticleEffect"/> to another <see cref="GTA.EntityBone"/> to simplify applying the same effect to many Entities.
        /// </summary>
        /// <param name="entityBone">The <see cref="GTA.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="GTA.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);
        }
コード例 #4
0
        /// <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);
        }