Elin Modding Docs Doc
Loading...
Searching...
No Matches
ScreenEffect.cs
1using System;
2using UnityEngine;
3
4// Token: 0x02000128 RID: 296
5public class ScreenEffect : EMono
6{
7 // Token: 0x060007F6 RID: 2038 RVA: 0x0003387A File Offset: 0x00031A7A
8 public static void Play(string id)
9 {
10 Util.Instantiate<ScreenEffect>("Media/Effect/ScreenEffect/" + id, Camera.main.transform);
11 }
12
13 // Token: 0x060007F7 RID: 2039 RVA: 0x00033898 File Offset: 0x00031A98
14 private void Awake()
15 {
16 if (base.transform.parent)
17 {
18 this.goParent = base.transform.parent.gameObject;
19 }
20 base.transform.SetParent(Camera.main.transform, false);
21 if (this.worldParticle)
22 {
23 ParticleSystem[] componentsInChildren = base.GetComponentsInChildren<ParticleSystem>();
24 for (int i = 0; i < componentsInChildren.Length; i++)
25 {
26 componentsInChildren[i].main.simulationSpace = ParticleSystemSimulationSpace.World;
27 }
28 }
29 }
30
31 // Token: 0x060007F8 RID: 2040 RVA: 0x00033914 File Offset: 0x00031B14
32 private void Update()
33 {
34 if (!this.goParent)
35 {
36 this.time += Time.unscaledDeltaTime;
37 if (!this.particleStopped && this.stopParticleTime != 0f && this.time > this.stopParticleTime)
38 {
39 foreach (ParticleSystem particleSystem in base.GetComponentsInChildren<ParticleSystem>())
40 {
41 if (particleSystem.transform.tag.Contains("ParticleEmitter"))
42 {
43 particleSystem.main.loop = false;
44 particleSystem.emission.enabled = false;
45 }
46 }
47 foreach (SoundEmitter soundEmitter in base.GetComponentsInChildren<SoundEmitter>())
48 {
49 if (soundEmitter.source)
50 {
51 soundEmitter.source.Stop(2f);
52 soundEmitter.source = null;
53 }
54 }
55 this.particleStopped = true;
56 }
57 if (this.time > this.killDuration)
58 {
59 UnityEngine.Object.Destroy(base.gameObject);
60 }
61 }
62 }
63
64 // Token: 0x04000835 RID: 2101
65 public bool worldParticle;
66
67 // Token: 0x04000836 RID: 2102
68 public float killDuration;
69
70 // Token: 0x04000837 RID: 2103
71 public float stopParticleTime;
72
73 // Token: 0x04000838 RID: 2104
74 private GameObject goParent;
75
76 // Token: 0x04000839 RID: 2105
77 private float time;
78
79 // Token: 0x0400083A RID: 2106
80 private bool particleStopped;
81}
Definition EMono.cs:6