//============================================================ public static void TurnOffLight(EchoLightType elt) { switch (elt) { case EchoLightType.MAIN_DIRECTIONAL: _echoDirLightColor = new Vector4(0, 0, 0, 0); Shader.SetGlobalColor("_echoDirLightColor", _echoDirLightColor); break; case EchoLightType.MAIN_POINT: _echoPointLightColor = new Vector4(0, 0, 0, 0); Shader.SetGlobalColor("_echoPointLightColor", _echoPointLightColor); break; default: break; } }
public void Init( ) { if (type == EchoLightType.FOUR_POINT) { EchoCoreManager.RemoveList(this); } if (uLight == null) { uLight = GetComponent <Light>(); } if (uLight == null) { return; } cachedTransform = uLight.transform; dist = 0; #if !UNITY_3_5 lightOn = gameObject.activeSelf; #else lightOn = gameObject.active; #endif if (uLight.renderMode == LightRenderMode.ForceVertex) { type = EchoLightType.FOUR_POINT; if (lightOn) { EchoCoreManager.AddList(this); } } else { switch (uLight.type) { case LightType.Point: type = EchoLightType.MAIN_POINT; break; default: type = EchoLightType.MAIN_DIRECTIONAL; break; } } #if UNITY_EDITOR if (Application.isPlaying && EchoCoreManager.useUnityLights == false) { uLight.enabled = false; } #else if (EchoCoreManager.useUnityLights == false) { uLight.enabled = false; } #endif }