void OnPreRender() { m_DirectionalLight = GetDirectionalLight(); if (m_DirectionalLight != null) { m_DirectionalLight.UpdateDirectionalShadowmap(); } }
void InitFogLight() { if (m_FogLight != null) { return; } // It should always be here, because it triggered this code path in the first place. m_FogLight = GetComponent <FogLight>(); }
void OnPreRender() { if (!CheckHardwareRequirements()) { return; } m_DirectionalLight = GetDirectionalLight(); if (m_DirectionalLight != null) { m_DirectionalLight.UpdateDirectionalShadowmap(); } }
FogLight GetDirectionalLight() { HashSet <FogLight> fogLights = LightManagerFogLights.Get(); FogLight fogLight = null; for (var x = fogLights.GetEnumerator(); x.MoveNext();) { var fl = x.Current; if (fl == null || fl.type != FogLight.Type.Directional || !fl.isOn) { continue; } fogLight = fl; break; } return(fogLight); }