当前位置: 首页>>代码示例>>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;未经允许,请勿转载。