當前位置: 首頁>>代碼示例>>C#>>正文


C# ParticleSystem.Play方法代碼示例

本文整理匯總了C#中UnityEngine.ParticleSystem.Play方法的典型用法代碼示例。如果您正苦於以下問題:C# ParticleSystem.Play方法的具體用法?C# ParticleSystem.Play怎麽用?C# ParticleSystem.Play使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UnityEngine.ParticleSystem的用法示例。


在下文中一共展示了ParticleSystem.Play方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Update

	// Update is called once per frame
	void Update () {
		if (Input.GetMouseButtonDown (0)) {
			clone = Instantiate (shotEffectPrefab, transform.position, transform.rotation) as ParticleSystem;
			clone.Play ();

		}
	}
開發者ID:almudi,項目名稱:JorgAnd,代碼行數:8,代碼來源:PistolFire.cs

示例2: setShield

 public void setShield(bool hasShield)
 {
     this.hasShield = true;
     shield = GetComponent<ParticleSystem>();
     shield.Play();
     StartCoroutine (KeepShield());
 }
開發者ID:psyllost,項目名稱:Walk-of-Death,代碼行數:7,代碼來源:PlayerController.cs

示例3: Awake

    void Awake()
    {
        //lane = 1;
        particles = transform.GetChild (0).gameObject.GetComponent<ParticleSystem> ();
        beam = transform.GetChild (1).gameObject.GetComponent<ParticleSystem> ();
        line = transform.GetChild (2).gameObject.GetComponent<LineRenderer> ();
        inLaserSequence = false;
        inSplitSequence = false;
        isActive = true;
        startFadeOut = false;
        startFadeIn = false;

        line.sortingLayerName = "Explosion/Fizz";
        transform.position += Vector3.up * -(lane - 2);
        if (Team == "Blue") {
            particles.transform.position = GameObject.FindGameObjectWithTag ("BlueBase").transform.position + Vector3.up * -(lane - 2);
        } else if (Team == "Red") {
            particles.transform.position = GameObject.FindGameObjectWithTag ("RedBase").transform.position + Vector3.up * -(lane - 2);
        }

        particles.Play ();
        Invoke ("beginBeam", 0.5f);
        Invoke ("drawLine", 1);
        Invoke ("setLooping", 2);
        Invoke ("setInactive", 1.5f);
        Invoke ("destroy", 3);
        Debug.Log (particles.gameObject.transform.position);
    }
開發者ID:Avekeez,項目名稱:Space-Wars-Unity,代碼行數:28,代碼來源:LaserLogic.cs

示例4: Start

 // Use this for initialization
 void Start()
 {
     psys = GetComponent<ParticleSystem>();
     psys.Play();
     if (!psys) Destroy(gameObject);
     Destroy(gameObject, psys.duration + psys.startLifetime);
 }
開發者ID:Nachtrind,項目名稱:Fungus,代碼行數:8,代碼來源:ParticleEffect.cs

示例5: Explode

    // fonction appelée lorsqu'un boulet de canon explose
    public void Explode(Vector3 position)
    {
        Vector3 dist;

        for(int i = 0; i < projectilePoolActive.Count; i++)
        {
            go = (GameObject) projectilePoolActive[i];

            dist = go.transform.position - position;

            if(dist.magnitude < 999){/*...*/}
        }

        if(fxPoolReady.Count > 0)
        {
            go = (GameObject) fxPoolReady[0];
            go.transform.position = position;
            go.SetActive(true);

            fx = go.GetComponent(typeof(FX)) as FX;
            fx.Trigger();

            ps = go.GetComponent(typeof(ParticleSystem)) as ParticleSystem;
            ps.Play();

            fxPoolReady.RemoveAt(0);
            fxPoolActive.Add(go);
        }
        print("<explode>");
    }
開發者ID:philvoyer,項目名稱:ANI2012A15,代碼行數:31,代碼來源:WeaponCannon.cs

示例6: Start

 void Start()
 {
     transform.Rotate(new Vector3(285f,350f,355f));
     particle = GetComponent<ParticleSystem>();
     particle.Play();
     Invoke ("Delete",particle.startLifetime);
 }
開發者ID:nickmly,項目名稱:FirstAssignmentGAME200,代碼行數:7,代碼來源:Explosion.cs

示例7: Start

 void Start()
 {
     stateController = GameObject.FindWithTag("Player").GetComponent<TurtleStateController>();
     forceVector = transform.forward * magnitude;
     particleSystem = GetComponent<ParticleSystem>();
     particleSystem.Play();
 }
開發者ID:piinecone,項目名稱:prototype3,代碼行數:7,代碼來源:DirectionalCurrentBehavior.cs

示例8: ParticleEffectInstanceManager

		public ParticleEffectInstanceManager(EffectManager effect_manager, Mesh character_mesh, bool letter_flipped, ParticleEffectSetup effect_setup, AnimationProgressionVariables progression_vars, AnimatePerOptions animate_per, ParticleEmitter particle_emitter = null, ParticleSystem particle_system = null)
		{
			m_particle_emitter = particle_emitter;
			m_particle_system = particle_system;
			m_letter_mesh = character_mesh;
			m_letter_flipped = letter_flipped;
			m_follow_mesh = effect_setup.m_follow_mesh;
			m_duration = effect_setup.m_duration.GetValue(progression_vars, animate_per);
			m_delay = effect_setup.m_delay.GetValue(progression_vars, animate_per);
			m_position_offset = effect_setup.m_position_offset.GetValue(progression_vars, animate_per);
			m_rotation_offset = Quaternion.Euler(effect_setup.m_rotation_offset.GetValue(progression_vars, animate_per));
			m_rotate_with_letter = effect_setup.m_rotate_relative_to_letter;
			m_effect_manager_handle = effect_manager;
			m_active = false;

			if(m_particle_emitter != null)
			{
				m_transform = m_particle_emitter.transform;

				m_particle_emitter.emit = true;
				m_particle_emitter.enabled = false;
			}
			else if(m_particle_system != null)
			{
				m_transform = m_particle_system.transform;

				m_particle_system.playOnAwake = false;
				m_particle_system.Play();
	#if !UNITY_3_5 && UNITY_EDITOR
				p_system_timer = 0;
	#endif
			}
		}
開發者ID:DarkRay,項目名稱:neverending-story,代碼行數:33,代碼來源:ParticleEffectInstanceManager.cs

示例9: Start

	// Use this for initialization
	void Start () {
		activeObjectList = new List<GameObject>();
		pushForce = new Vector2(0.0f, 0.0f);
		particles = gameObject.GetComponent<ParticleSystem>();
		emis = particles.emission;
		emis.enabled = false;
		particles.Play();
	}
開發者ID:ReidBix,項目名稱:momentum,代碼行數:9,代碼來源:SoftRepulsor.cs

示例10: Play

    public override void Play(GameObject target)
    {
        // Get particle system
        _particleSystem = target.GetComponent<ParticleSystem>();

        _particleSystem.time = 0;
        _particleSystem.Play();
    }
開發者ID:moto2002,項目名稱:UnityCustomAction,代碼行數:8,代碼來源:PlayPSAction.cs

示例11: LevelIncrease

 public void LevelIncrease()
 {
     levelUp = GameObject.Find ("Level_Up_Popup").GetComponent<ParticleSystem> ();
     levelUp.Stop();
     level++;
     levelUp.enableEmission = true;
     levelUp.Play();
 }
開發者ID:hazlett,項目名稱:Parkinsons,代碼行數:8,代碼來源:LevelSystem.cs

示例12: Start

    void Start()
    {
        ps = GetComponent<ParticleSystem>();
        ps.Stop();

        RandSize();
        ps.Play();
        //StartCoroutine(SetTime());
    }
開發者ID:NWin95,項目名稱:Guerrilla,代碼行數:9,代碼來源:CloudScript.cs

示例13: CheckCurrentSmoke

 void CheckCurrentSmoke(ref ParticleSystem compareWith)
 {
     if (currentSmoke.name != compareWith.name)              // if currentSmoke isn't the same that compareWith smoke
     {
         currentSmoke.Stop();                                // stop Playing current smoke
         currentSmoke = compareWith;                         // set currentSmoke to correct smoke that we compare with
         currentSmoke.Play();                                // Play smoke
     }
 }
開發者ID:darthachill,項目名稱:SpaceShooter,代碼行數:9,代碼來源:SmokeController.cs

示例14: Start

 void Start()
 {
     transform.LookAt(PlayerStats.Player.transform.position);
     PS = GetComponent<ParticleSystem>();
     AS = GetComponent<AudioSource>();
     Value = HitObject.GetComponent<SteamAmount>().Amount;
     PS.Play();
     StartCoroutine(CheckSteamAudio());
 }
開發者ID:Nortrix0,項目名稱:Beyond-Equilibrium,代碼行數:9,代碼來源:SteamHole.cs

示例15: Start

 // Use this for initialization
 void Start()
 {
     source = GetComponent<AudioSource>();
     _smoke = Instantiate(Resources.Load("Smoke") as GameObject);
     _smoke.transform.parent = transform;
     _smoke.transform.position = transform.position;
     smoke = _smoke.GetComponent<ParticleSystem>();
     smoke.Play();
 }
開發者ID:jiminl5,項目名稱:batilda,代碼行數:10,代碼來源:Furnace.cs


注:本文中的UnityEngine.ParticleSystem.Play方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。