Beispiel #1
0
        public override void OnDeath()
        {
            Debug.DrawText("Drill destroyed!", 3, Color.Red, 5);
            StopAnimation(blendOutTime: 1);

            m_destroyedEffect = ParticleEffect.Get("smoke_and_fire.Vehicle_fires.large2");
            m_destroyedEffect.Spawn(Position);
        }
Beispiel #2
0
        internal static ParticleEffect TryGet(IntPtr handle)
        {
#if !(RELEASE && RELEASE_DISABLE_CHECKS)
            if (handle == IntPtr.Zero)
            {
                throw new NullPointerException();
            }
#endif
            var particleEffect = particleEffects.FirstOrDefault(x => x.Handle == handle);
            if (particleEffect == null)
            {
                particleEffect = new ParticleEffect(handle);
                particleEffects.Add(particleEffect);
            }

            return(particleEffect);
        }
Beispiel #3
0
 public ParticleEmitter LoadParticleEmitter(ParticleEffect particleEffect, ref ParticleSpawnParameters spawnParams, int slot = -1)
 {
     return ParticleEmitter.TryGet(NativeEntityMethods.LoadParticleEmitter(this.GetIEntity(), slot, particleEffect.Handle, ref spawnParams));
 }
Beispiel #4
0
 public void SwitchToParticleEffectObject(ParticleEffect effect, Vec3 offset, Vec3 dir, float scale)
 {
     NativeEntityMethods.BindAttachmentToParticleEffect(Handle, effect.Handle, offset, dir, scale);
 }
Beispiel #5
0
        internal static ParticleEffect TryGet(IntPtr handle)
        {
            #if !(RELEASE && RELEASE_DISABLE_CHECKS)
            if (handle == IntPtr.Zero)
                throw new NullPointerException();
            #endif
            var particleEffect = particleEffects.FirstOrDefault(x => x.Handle == handle);
            if (particleEffect == null)
            {
                particleEffect = new ParticleEffect(handle);
                particleEffects.Add(particleEffect);
            }

            return particleEffect;
        }
Beispiel #6
0
 public ParticleEmitter LoadParticleEmitter(ParticleEffect particleEffect, ref ParticleSpawnParameters spawnParams, int slot = -1)
 {
     return(ParticleEmitter.TryGet(NativeEntityMethods.LoadParticleEmitter(this.GetIEntity(), slot, particleEffect.Handle, ref spawnParams)));
 }
Beispiel #7
0
        public ParticleEmitter LoadParticleEmitter(ParticleEffect particleEffect, ref ParticleSpawnParameters spawnParams, int slot = -1)
        {
            var ptr = NativeEntityMethods.LoadParticleEmitter(this.GetIEntity(), slot, particleEffect.Handle, ref spawnParams);
            if (ptr != IntPtr.Zero)
                return new ParticleEmitter(ptr);

            return null;
        }
Beispiel #8
0
 public void SwitchToParticleEffectObject(ParticleEffect effect, Vec3 offset, Vec3 dir, float scale)
 {
     NativeEntityMethods.BindAttachmentToParticleEffect(Handle, effect.Handle, offset, dir, scale);
 }