protected override void OnLightExit(LightBase source) { if (reflectedLights.ContainsKey(source)) { RemoveLight(source); } }
private void RemoveLight(LightBase source) { LightBeam lightBeam = (LightBeam)reflectedLights[source]; consume.ignoreLights.Remove(lightBeam); lightBeam.DisableLight(); reflectedLights.Remove(source); }
private void OnTriggerStay(Collider other) { LightBase componentInParent = other.GetComponentInParent <LightBase>(); if (!(componentInParent == null)) { AddLightSource(componentInParent); } }
private void OnTriggerEnter(Collider other) { LightBase componentInParent = other.GetComponentInParent <LightBase>(); if (!(componentInParent == null)) { if (debugLog) { Debug.Log("Enter " + other.name); } AddLightSource(componentInParent); } }
private void OnTriggerExit(Collider other) { LightBase componentInParent = other.GetComponentInParent <LightBase>(); if (!(componentInParent == null)) { if (debugLog) { Debug.Log("Exit " + other.name); } RemoveLightSource(componentInParent); componentInParent.UpdateLight(); } }
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) { }
public LightHitInfo(LightBase s, float intensity) { this.intensity = intensity; source = s; outputs = new List <LightBase>(); }
public LightHitInfo(LightBase s) { source = s; outputs = new List <LightBase>(); }