Ejemplo n.º 1
0
 private void Update()
 {
     if (!(emittedLight == null) && (emittedLight.transform.position != base.transform.position || emittedLight.Direction == Direction))
     {
         emittedLight.transform.position = base.transform.position;
         emittedLight.Direction          = Direction;
         emittedLight.UpdateLight();
     }
 }
Ejemplo n.º 2
0
        private void OnTriggerExit(Collider other)
        {
            LightBase componentInParent = other.GetComponentInParent <LightBase>();

            if (!(componentInParent == null))
            {
                if (debugLog)
                {
                    Debug.Log("Exit " + other.name);
                }
                RemoveLightSource(componentInParent);
                componentInParent.UpdateLight();
            }
        }
Ejemplo n.º 3
0
 private void AddLightSource(LightBase source)
 {
     if (!ignoreLights.Contains(source) && !lightHits.ContainsKey(source))
     {
         source.AddConsume(this);
         LightHitInfo lightHitInfo = new LightHitInfo(source);
         Recalculate(lightHitInfo);
         lightHits.Add(source, lightHitInfo);
         if (debugLog)
         {
             Debug.Log("Added new light source: " + source.name);
         }
         lightAdded(source);
         source.UpdateLight();
     }
 }