1234567891011121314151617181920212223242526272829 |
- using UnityEngine;
- using System.Collections;
- using ParticlePlayground;
- public class FTME01_LoopSwitch : MonoBehaviour {
- public float loopOffTiming = 0;
- float currentTime;
- public Transform parentTransform;
- PlaygroundParticlesC[] particleSystems;
- // Use this for initialization
- void Start () {
- particleSystems = parentTransform.GetComponentsInChildren<PlaygroundParticlesC>();
- currentTime = 0;
- }
-
- // Update is called once per frame
- void Update () {
- if (loopOffTiming != 0) {
- currentTime += Time.deltaTime;
- if (currentTime > loopOffTiming) {
- foreach (PlaygroundParticlesC particles in particleSystems)
- particles.loop = false;
- }
- }
-
- }
- }
|