Beispiel #1
0
 protected override void OnLightExit(LightBase source)
 {
     if (reflectedLights.ContainsKey(source))
     {
         RemoveLight(source);
     }
 }
Beispiel #2
0
        private void RemoveLight(LightBase source)
        {
            LightBeam lightBeam = (LightBeam)reflectedLights[source];

            consume.ignoreLights.Remove(lightBeam);
            lightBeam.DisableLight();
            reflectedLights.Remove(source);
        }
Beispiel #3
0
        private void OnTriggerStay(Collider other)
        {
            LightBase componentInParent = other.GetComponentInParent <LightBase>();

            if (!(componentInParent == null))
            {
                AddLightSource(componentInParent);
            }
        }
Beispiel #4
0
        private void OnTriggerEnter(Collider other)
        {
            LightBase componentInParent = other.GetComponentInParent <LightBase>();

            if (!(componentInParent == null))
            {
                if (debugLog)
                {
                    Debug.Log("Enter " + other.name);
                }
                AddLightSource(componentInParent);
            }
        }
Beispiel #5
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();
            }
        }
Beispiel #6
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();
     }
 }
 public virtual void EnableLight()
 {
     isOn         = true;
     emittedLight = CreateLight();
 }
 protected virtual void OnLightExit(LightBase source)
 {
 }
Beispiel #9
0
 public LightHitInfo(LightBase s, float intensity)
 {
     this.intensity = intensity;
     source         = s;
     outputs        = new List <LightBase>();
 }
Beispiel #10
0
 public LightHitInfo(LightBase s)
 {
     source  = s;
     outputs = new List <LightBase>();
 }