Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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));
 }
Esempio n. 4
0
 public void SwitchToParticleEffectObject(ParticleEffect effect, Vec3 offset, Vec3 dir, float scale)
 {
     NativeEntityMethods.BindAttachmentToParticleEffect(Handle, effect.Handle, offset, dir, scale);
 }
Esempio n. 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;
        }
Esempio n. 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)));
 }
Esempio n. 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;
        }
Esempio n. 8
0
 public void SwitchToParticleEffectObject(ParticleEffect effect, Vec3 offset, Vec3 dir, float scale)
 {
     NativeEntityMethods.BindAttachmentToParticleEffect(Handle, effect.Handle, offset, dir, scale);
 }