예제 #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();
     }
 }
예제 #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();
            }
        }
예제 #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();
     }
 }