Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
LightControl2.cs
Go to the documentation of this file.
1using UnityEngine;
2
3[ExecuteInEditMode]
4public class LightControl2 : MonoBehaviour
5{
6 public bool enableLight = true;
7
8 public bool enableHaze = true;
9
10 public float lightRange = 300f;
11
12 public float lightIntensity = 1f;
13
14 [Range(0f, 255f)]
15 public float hazeLevel = 200f;
16
17 [HideInInspector]
19
20 private ParticleSystem.TrailModule partcleTrail;
21
22 private ParticleSystem.LightsModule lightPart;
23
24 private void Start()
25 {
26 }
27
28 private void OnEnable()
29 {
30 partcleTrail = base.gameObject.GetComponent<ParticleSystem>().trails;
31 lightPart = particleLight.transform.parent.gameObject.GetComponent<ParticleSystem>().lights;
32 }
33
34 private void Update()
35 {
36 partcleTrail.enabled = enableHaze;
37 lightPart.enabled = enableLight;
38 particleLight.range = lightRange;
39 particleLight.intensity = lightIntensity;
40 Color color = partcleTrail.colorOverLifetime.color;
41 color.a = hazeLevel / 255f;
42 partcleTrail.colorOverLifetime = color;
43 }
44}
float lightIntensity
Light particleLight
ParticleSystem.LightsModule lightPart
ParticleSystem.TrailModule partcleTrail