예제 #1
0
 private static void Nuke(BaseFoo foo)
 {
     if (foo is DustPuff)
     {
         DustPuff puff = foo as DustPuff;
         puff.Emitter.RemoveFromManager();
         dustPuffs.Add(puff);
     }
     else if (foo is SteamPuff)
     {
         SteamPuff puff = foo as SteamPuff;
         puff.Emitter.RemoveFromManager();
         steamPuffs.Add(puff);
     }
     else if (foo is Explosion)
     {
         Explosion explosion = foo as Explosion;
         explosion.fireball.RemoveFromManager();
         explosion.smoke.RemoveFromManager();
         explosions.Add(explosion);
     }
     else if (foo is BeamExplosion)
     {
         BeamExplosion beamExplosion = foo as BeamExplosion;
         beamExplosion.beamFireball.RemoveFromManager();
         beamExplosion.beamSmoke.RemoveFromManager();
         beamExplosions.Add(beamExplosion);
     }
     else if (foo is ScanVFX)
     {
         ScanVFX scanVFX = foo as ScanVFX;
         scanVFX.scanExplode.RemoveFromManager();
         scanVFX.scanSmoke.RemoveFromManager();
         scanVFXs.Add(scanVFX);
     }
     else if (foo is RoverScanEffect)
     {
         RoverScanEffect roverEffect = foo as RoverScanEffect;
         roverEffect.scanExplode.RemoveFromManager();
         roverEffect.scanSmoke.RemoveFromManager();
         roverEffects.Add(roverEffect);
     }
     else if (foo is InspectVFX)
     {
         InspectVFX inspect = foo as InspectVFX;
         inspect.inspectExplode.RemoveFromManager();
         inspect.inspectSmoke.RemoveFromManager();
         inspectVFXs.Add(inspect);
     }
 }
예제 #2
0
        private static ScanVFX NewScanEffect()
        {
            ScanVFX ret = null;

            if (scanVFXs.Count > 0)
            {
                ret = scanVFXs[scanVFXs.Count - 1];
                scanVFXs.RemoveAt(scanVFXs.Count - 1);
            }
            else
            {
                ret = new ScanVFX();
            }
            return(ret);
        }
예제 #3
0
        }   // end of ExplosionManager CreateBeamExplosion()

        /// <summary>
        /// Public call which allows the creation of an scan effect from anywhere in game.
        /// </summary>
        /// <param name="position">Where the explosion occurs.</param>
        /// <param name="radius">Approximate size of the explosion.</param>
        public static void CreateScanEffect(Vector3 position, float radius)
        {
            ScanVFX e = NewScanEffect();

            e.position = position;
            e.radius   = radius;

            e.scanSmokeDuration  = 0.7f;
            e.scanSmoke          = new ScanSmokeEmitter(InGame.inGame.ParticleSystemManager);
            e.scanSmoke.Position = position;
            e.scanSmoke.ResetPreviousPosition();
            e.scanSmoke.PositionJitter  = 0.0f; // Random offset for each particle.
            e.scanSmoke.StartRadius     = radius * 0.5f;
            e.scanSmoke.EndRadius       = radius;
            e.scanSmoke.EmissionRate    = 20.0f;
            e.scanSmoke.Gravity         = new Vector3(0.0f, 0.0f, 100.0f);
            e.scanSmoke.Color           = new Vector4(0.2f, 0.6f, 0.3f, 0.5f);
            e.scanSmoke.MaxRotationRate = 0.0f;
            e.scanSmoke.Active          = true;

            e.scanExplosionDuration = 0.05f;
            e.scanExplode           = new ScanExplosionEmitter(InGame.inGame.ParticleSystemManager);
            e.scanExplode.Position  = position;
            e.scanExplode.ResetPreviousPosition();
            e.scanExplode.PositionJitter  = 0.0f;  // Random offset for each particle.
            e.scanExplode.StartRadius     = radius * 0.2f;
            e.scanExplode.EndRadius       = radius * 0.8f;
            e.scanExplode.EmissionRate    = 80.0f;
            e.scanExplode.Gravity         = new Vector3(0.0f, 0.0f, 100.0f);
            e.scanExplode.MinLifetime     = 0.5f;
            e.scanExplode.MaxLifetime     = 1.0f;
            e.scanExplode.MaxRotationRate = 0.0f;
            e.scanExplode.Color           = new Vector4(1.0f, 1.0f, 1.0f, 1.0f);
            e.scanExplode.Active          = true;

            e.startTime = Time.GameTimeTotalSeconds;

            e.scanSmoke.AddToManager();
            e.scanExplode.AddToManager();

            fooList.Add(e);
        }   // end of ExplosionManager CreateScanEffect()