当前位置: 首页>>代码示例>>C#>>正文


C# ParticleSystem.Clear方法代码示例

本文整理汇总了C#中UnityEngine.ParticleSystem.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# ParticleSystem.Clear方法的具体用法?C# ParticleSystem.Clear怎么用?C# ParticleSystem.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.ParticleSystem的用法示例。


在下文中一共展示了ParticleSystem.Clear方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnEnter

		public override void OnEnter()
		{
			ps = Fsm.GetOwnerDefaultTarget(gameObject).GetComponent<ParticleSystem>();


			if (delay.Value <= 0)
			{
				if (clear.Value) {
					stopWithClear.Value = false;
					ps.Clear();
				}

				else { 
					ps.Stop();
					ps.Clear();

				}

				if(finishEvent != null) Fsm.Event(finishEvent);{
				Finish();
				return;
			}
			}
			
			startTime = Time.realtimeSinceStartup;
			timer = 0f;
		}
开发者ID:BHD7,项目名称:Ghost_Town_FPS_Zombies,代码行数:27,代码来源:particleSystemClear.cs

示例2: Start

 // Use this for initialization
 void Start()
 {
     part = GetComponent<ParticleSystem>();
     audio = GetComponent<AudioSource>();
     part.Stop();
     part.Clear();
 }
开发者ID:UCCS-GDD,项目名称:CS3350-StarPower,代码行数:8,代码来源:SparkScript.cs

示例3: Start

 // Use this for initialization
 void Start()
 {
     part = transform.FindChild( "ShockwaveParticleSystem" ).gameObject.GetComponent<ParticleSystem>();
     part.Clear();
     part.enableEmission = false;
     transform.localScale = new Vector3( 0, 0, 0 );
     shouldPlay = false;
 }
开发者ID:JonECG,项目名称:Milo-s-Misadventures,代码行数:9,代码来源:ShockwaveController.cs

示例4: charge

    public void charge(GameObject particles)
    {
        partSys = particles.GetComponent<ParticleSystem> ();

        if (currentBattery < maxBattery) {
            partSys.Pause ();
            isCharging = true;
        } else
            partSys.Clear ();
    }
开发者ID:seanmckeever16,项目名称:SeansGeniusLoci,代码行数:10,代码来源:PlayerBattery.cs

示例5: Start

    //    private PlayerController playerScript;
    // Use this for initialization
    void Start()
    {
        GameObject.Find ("Loading Screen").GetComponent<Canvas> ().enabled = false;
        attributesScript = this.GetComponent<PlayerAttributes> ();
        levelUp = GameObject.Find ("LevelUp").GetComponent<ParticleSystem> ();
        levelUp.enableEmission = false;
        levelUp.Clear ();

        //playerScript = this.GetComponent<PlayerController> ();
    }
开发者ID:Elzahn,项目名称:IMY300,代码行数:12,代码来源:CharacterSelection.cs

示例6: Start

 // Use this for initialization
 void Start()
 {
     chargingEffectIn = GetComponent<ParticleSystem>();
     rb = GetComponent<Rigidbody>();
     position = new Vector3(transform.position.x, 0.0f, transform.position.z);
     isHere = false;
     chargingEffectIn.Stop();
     chargingEffectIn.Clear();
     rotationY.Set(0f, 0f, 0f);
     rotationY = rotationY.normalized*tumble;
     Quaternion deltaRotation = Quaternion.Euler(rotationY);
     //print("charger:" + position.x + " " + position.z);
 }
开发者ID:zmedgyes,项目名称:Unity,代码行数:14,代码来源:ChargerServer.cs

示例7: Awake

    void Awake()
    {
        lights = gameObject.GetComponentsInChildren<Light>();
        flames = gameObject.GetComponentInChildren<ParticleSystem>();
        if ((row == 0 || row == 2) || (column == 0 || column == 2))
        {
            lights[0].enabled = false;
            lights[1].enabled = false;
            lights[2].enabled = false;
            flames.Pause();
            flames.Clear();
            isActive = false;
        }

        puzzleManager = GameObject.FindObjectOfType<LightsOn>();
    }
开发者ID:MatthewNelson2015,项目名称:UND-Capstone-Game-2014-2015,代码行数:16,代码来源:Torch.cs

示例8: AutoReleaseParticle

    public IEnumerator AutoReleaseParticle(string prefabName, ParticleSystem particle, PrefabPoolAgent agent)
    {
        yield return new WaitForSeconds(particle.startDelay + 0.25f);

        GameObject go = particle.gameObject;
        while (particle.IsAlive(true) && go.activeInHierarchy)
        {
            yield return null;
        }

        if (go.activeInHierarchy)
        {
            Despawn(prefabName, agent);
            particle.Clear(true);
        }
    }
开发者ID:meta-42,项目名称:uEasyKit,代码行数:16,代码来源:PrefabPool.cs

示例9: ListenToDespawn

        protected IEnumerator ListenToDespawn(ParticleSystem emitter)
        {
            // Wait for the delay time to complete
            // Waiting the extra frame seems to be more stable and means at least one 
            //  frame will always pass
            yield return new WaitForSeconds(emitter.startDelay + 0.25f);
						
            while (emitter.IsAlive(true))
            {
                if (!emitter.gameObject.activeInHierarchy)
                {
                    emitter.Clear(true);
                    yield break;  // Do nothing, already despawned. Quit.
                }

                yield return null;
            }

            // Turn off emit before despawning
            InstanceManager.Despawn(this.poolName, emitter.transform);
        }
开发者ID:TripleLoopGames,项目名称:space-roaches,代码行数:21,代码来源:SelfDespawn.cs

示例10: Start

    public void Start()
    {
        god = GameObject.Find("God").GetComponent<SoundGod>();
        tickTime = 1.0 / goldTicksPerSecond;
        tickTimer = 0.0;

        carController = transform.parent.transform.parent.GetComponent<StephenCarController>();

        line = gameObject.GetComponent<LineRenderer>();
        system = gameObject.transform.GetChild(0).transform.GetChild(0).GetComponentInChildren<ParticleSystem>();
        system.enableEmission = false;
        system.Clear();
        //EraseLine();
    }
开发者ID:Stansey09,项目名称:GolbBlitzHub,代码行数:14,代码来源:GoldGunBox.cs

示例11: Start

    // Use this for initialization
    protected virtual void Start()
    {
        // set the primaryNode to the Weapons_Primary
        var primaryNode = transform.FindChild("Weapons_Primary");

        // Checks the child count of primaryNode
        for (int i = primaryNode.transform.childCount - 1; i >= 0; i--)
        {
            // set weapon to instanstiate a GameObject as a Weapon
            var weapon = GameObject.Instantiate(PrimaryWeapon, primaryNode.GetChild(i).transform.position, primaryNode.transform.rotation) as Weapon;

            // set weapons parents to the primaryNode
            weapon.transform.parent = primaryNode;

            // add the weapon to the list of primaryWeapons
            primaryWeapons.Add(weapon);
        }
        // set speed to calculate the speed
        speed = CalculateSpeed();

        // if shield is not null
        if (Shield != null)
            // get the collider2D component
            shieldCollider = Shield.GetComponent<Collider2D>();

        // set smoking and fire effects to false
        isSmoking = false;
        isOnFire = false;

        //load particle effect SMOKE
        smoke = (GameObject)Instantiate(Resources.Load("SmokeParticleSystem"));
        smoke.transform.parent = this.gameObject.transform;

        smokeSystem = smoke.GetComponent<ParticleSystem> ();

        smokeSystem.Clear ();
        smokeSystem.Stop();

        //load particle effect FIRE
        fire = (GameObject)Instantiate(Resources.Load("FireParticleSystem"));
        fire.transform.parent = this.gameObject.transform;

        fireSystem = fire.GetComponent<ParticleSystem> ();

        fireSystem.Clear ();
        fireSystem.Stop();
    }
开发者ID:UCCS-GDD,项目名称:CS3350-StarPower,代码行数:48,代码来源:Ship.cs

示例12: Start

	void Start () 
	{
		m_Particle = Instantiate(m_Particle, this.transform.position, this.transform.rotation) as ParticleSystem;
		m_Particle.Stop();
		m_Particle.Clear();	
	}
开发者ID:jonwa,项目名称:Project-Alix,代码行数:6,代码来源:ParticleEffect.cs

示例13: Awake

    // Private Functions
    // Awake(): is called at the start of the program
    void Awake()
    {
        // Singleton
        if (s_Instance == null)
            s_Instance = this;
        else
            Destroy(this.gameObject);

        float resultColor;
        // while: Initialise a color and checks if the color is acceptable
        // Since HSV input of colors is harder to implement,
        // it converts RGB into one OVERALL value and check if is within fMinimumArtilleryRGB and fMaximumArtilleryRGB range
        do
        {
            colorArtillery = new Color(UnityEngine.Random.value, UnityEngine.Random.value, UnityEngine.Random.value, 1f);
            resultColor = colorArtillery.r + colorArtillery.g + colorArtillery.b;

        } while (resultColor < 3f * fMinimumArtilleryRGB || resultColor > 3f * fMaximumArtilleryRGB);

        // Read level specific settings from Settings.cs
        colorArtillery = Settings.s_EnvironmentColor;
        fNutrientsChance = Settings.s_fPlayerNutrientChance;
        fWallSidesSpeed = Settings.s_fSideWallSpeed;
        fWallBackgroundSpeed = Settings.s_fBackgroundSpeed;

        // Background particle system set-up
        bgParticleSystem = transform.GetChild(2).GetComponent<ParticleSystem>();
        // Use the same color as the wall-sides and background
        bgParticleSystem.startColor = colorArtillery;
        // Set the starting speed from Settings.cs
        bgParticleSystem.startSpeed = Settings.s_fParticleStartSpeedMultiplier;
        // Since prewarm of particle systems doesn't adapt to the new color, the particle system will be simulated beforehand
        bgParticleSystem.Clear();
        bgParticleSystem.Simulate(bgParticleSystem.startLifetime);
        bgParticleSystem.Play();

        mAnimate = new Animate(transform.GetChild(0)); // Pool_WallSidesRenderer
    }
开发者ID:raynertanxw,项目名称:GDP_Cellulose,代码行数:40,代码来源:Wall.cs

示例14: ListenForEmitDespawn

        private IEnumerator ListenForEmitDespawn(ParticleSystem emitter)
        {
            yield return new WaitForSeconds(emitter.startDelay + 0.25f);

            float safetimer = 0;
            GameObject emitterGO = emitter.gameObject;
            while (emitter.IsAlive(true) && emitterGO.activeInHierarchy)
            {
                safetimer += Time.deltaTime;
                if (safetimer > MaxParticleDespawnTime)
                {
                    Debug.LogWarning
                    (
                          string.Format
                          (
                              "SpawnPool {0}: " +
                                  "Timed out while listening for all particles to die. " +
                                  "Waited for {1}sec.", PoolName, MaxParticleDespawnTime
                          )
                      );
                }
                yield return null;
            }

            if (emitterGO.activeInHierarchy)
            {
                Despawn(emitter.transform);
                emitter.Clear(true);
            }
        }
开发者ID:woshihuo12,项目名称:UnityHello,代码行数:30,代码来源:SimplePoolManager.cs

示例15: particleToggle

	/// <summary>
	/// Enables or disables the specified particle system
	/// </summary>
	/// <param name="partSys">Particle system to enable.</param>
	/// <param name="toggle">If set to <c>true</c> system will be enabled.</param>
	void particleToggle(ParticleSystem partSys, bool toggle){
		if (toggle){
			partSys.enableEmission = toggle;
			partSys.Simulate(3);
			partSys.Play();
		}
		else {
			partSys.Stop();
			partSys.Clear();
		}

	}
开发者ID:UnofficialSpaceHulkTeam,项目名称:UnofficialSpaceHulk,代码行数:17,代码来源:InputOutput.cs


注:本文中的UnityEngine.ParticleSystem.Clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。