8 public static void Play(
string id)
10 Util.Instantiate<
ScreenEffect>(
"Media/Effect/ScreenEffect/" + id, Camera.main.transform);
16 if (base.transform.parent)
18 this.goParent = base.transform.parent.gameObject;
20 base.transform.SetParent(Camera.main.transform,
false);
21 if (this.worldParticle)
23 ParticleSystem[] componentsInChildren = base.GetComponentsInChildren<ParticleSystem>();
24 for (
int i = 0; i < componentsInChildren.Length; i++)
26 componentsInChildren[i].main.simulationSpace = ParticleSystemSimulationSpace.World;
36 this.time += Time.unscaledDeltaTime;
37 if (!this.particleStopped && this.stopParticleTime != 0f && this.time > this.stopParticleTime)
39 foreach (ParticleSystem particleSystem
in base.GetComponentsInChildren<ParticleSystem>())
41 if (particleSystem.transform.tag.Contains(
"ParticleEmitter"))
43 particleSystem.main.loop =
false;
44 particleSystem.emission.enabled =
false;
47 foreach (SoundEmitter soundEmitter
in base.GetComponentsInChildren<SoundEmitter>())
49 if (soundEmitter.source)
51 soundEmitter.source.Stop(2f);
52 soundEmitter.source =
null;
55 this.particleStopped =
true;
57 if (this.time > this.killDuration)
59 UnityEngine.Object.Destroy(base.gameObject);
65 public bool worldParticle;
68 public float killDuration;
71 public float stopParticleTime;
74 private GameObject goParent;
80 private bool particleStopped;