Subversion Repository Public Repository

Nextrek

Diff Revisions 167 vs 168 for /3DSpace/Assets/SpaceUnity/_Demo/Scrips/SU_LaserImpact.cs

Diff revisions: vs.
  @@ -27,7 +27,7 @@
27 27 // Cache the transform to improve performance
28 28 _cacheLight = transform.Find("light");
29 29 // Find the child light and set intensity to 1.0
30 - _cacheLight.light.intensity = 1.0f;
30 + _cacheLight.GetComponent<Light>().intensity = 1.0f;
31 31 // Move the transform 5 units out so it's not spawn at impact point of the collider/mesh it just hit
32 32 // which will light up the object better.
33 33 _cacheLight.transform.Translate(Vector3.up*5, Space.Self);
  @@ -42,7 +42,7 @@
42 42 // If the light exists...
43 43 if (_cacheLight != null) {
44 44 // Set the intensity depending on the number of particles visible
45 - _cacheLight.light.intensity = (float) (transform.particleEmitter.particleCount / 50.0f);
45 + _cacheLight.GetComponent<Light>().intensity = (float) (transform.GetComponent<ParticleEmitter>().particleCount / 50.0f);
46 46 }
47 47 }
48 48 }