UnityEngine.ParticleSystem.Stop C# (CSharp) Method

Stop() public method

public Stop ( [ withChildren ) : void
withChildren [
return void
        public void Stop([DefaultValue("true")] bool withChildren)
        {
            if (withChildren)
            {
                foreach (ParticleSystem system in GetParticleSystems(this))
                {
                    system.Internal_Stop();
                }
            }
            else
            {
                this.Internal_Stop();
            }
        }

Same methods

ParticleSystem::Stop ( ) : void
ParticleSystem::Stop ( bool withChildren ) : void

Usage Example

コード例 #1
0
    // Start
    void Start()
    {
        myParticleSystem = particleSystem;

        // Server side doesn't compute particles
        if(uLink.Network.isServer) {
            // Disable emission
            myParticleSystem.enableEmission = false;

            if(!myParticleSystem.isStopped)
                myParticleSystem.Stop();

            // Is there a delayed explosion component?
            var delayedExplosion = GetComponent<DelayedExplosion>();

            // Destroy this object after the standard duration of the particle system
            if(delayedExplosion == null)
                Destroy(gameObject, myParticleSystem.duration);
            else
                Destroy(gameObject, delayedExplosion.delayTime + 0.1f);

            // No LateUpdate on the server
            enabled = false;
        }
    }
All Usage Examples Of UnityEngine.ParticleSystem::Stop