Пример #1
0
        protected override void AfterDestroy()
        {
            base.AfterDestroy();

            // Remove all particle systems from the manager and destroy it
            if (_particleSystemManager != null)
            {
                _particleSystemManager.RemoveAllParticleSystems();
                _particleSystemManager = null;
            }

            // Destroy all of the particle systems
            if (_debrisParticleSystem != null)
            {
                _debrisParticleSystem.Destroy();
                _debrisParticleSystem = null;
            }

            if (_fireSmokeParticleSystem != null)
            {
                _fireSmokeParticleSystem.Destroy();
                _fireSmokeParticleSystem = null;
            }

            if (_flashParticleSystem != null)
            {
                _flashParticleSystem.Destroy();
                _flashParticleSystem = null;
            }

            if (_flyingSparksParticleSystem != null)
            {
                _flyingSparksParticleSystem.Destroy();
                _flyingSparksParticleSystem = null;
            }

            if (_roundSparksParticleSystem != null)
            {
                _roundSparksParticleSystem.Destroy();
                _roundSparksParticleSystem = null;
            }

            if (_shockwaveParticleSystem != null)
            {
                _shockwaveParticleSystem.Destroy();
                _shockwaveParticleSystem = null;
            }

            if (_smokeTrailsParticleSystem != null)
            {
                _smokeTrailsParticleSystem.Destroy();
                _smokeTrailsParticleSystem = null;
            }
        }