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