internal void Light() { allLights = LightObject.GetLights(); DirectionalLights.Clear(); PointLights.Clear(); SpotLights.Clear(); for (int i = 0; i < allLights.Count; i++) { if (allLights[i].type == LightType.Spot) { //if (l.cookie == null) // l.cookie = DefaultSpotCookie; SpotLights.Add(allLights[i]); } else if (allLights[i].type == LightType.Point) { PointLights.Add(allLights[i]); } else if (allLights[i].type == LightType.Directional) { if (Graphics.Instance.Settings.UsePCSS) { if (null == pcss) { pcss = allLights[i].light.GetOrAddComponent <PCSSLight>(); } if (null != pcss) { pcss.enabled = true; } } else { if (null == pcss) { pcss = allLights[i].light.GetComponent <PCSSLight>(); } if (null != pcss) { pcss.enabled = false; } } DirectionalLights.Add(allLights[i]); } if (UseAlloyLight) { allLights[i].light.GetOrAddComponent <AlloyAreaLight>().UpdateBinding(); } } }
private IEnumerator Start() { if (IsStudio()) { StudioHooks.Init(); } yield return(new WaitUntil(() => { return IsLoaded(); })); Settings = new GlobalSettings(); CameraSettings = new CameraSettings(); LightingSettings = new LightingSettings(); PostProcessingSettings = new PostProcessingSettings(CameraSettings.MainCamera); SSSSettings = new SSSSettings(); _sssManager = new SSSManager(); _sssManager.Initialize(); _skyboxManager = Instance.GetOrAddComponent <SkyboxManager>(); _skyboxManager.Parent = this; _skyboxManager.AssetPath = ConfigCubeMapPath.Value; _skyboxManager.Logger = Logger; DontDestroyOnLoad(_skyboxManager); _postProcessingManager = Instance.GetOrAddComponent <PostProcessingManager>(); _postProcessingManager.Parent = this; _postProcessingManager.LensDirtTexturesPath = ConfigLensDirtPath.Value; DontDestroyOnLoad(_postProcessingManager); LocalizationManager.Parent = this; LocalizationManager.CurrentLanguage = ConfigLanguage.Value; _lightManager = new LightManager(this); _presetManager = new PresetManager(ConfigPresetPath.Value, this); yield return(new WaitUntil(() => PCSSLight.LoadAssets())); yield return(new WaitUntil(() => SEGI.LoadAssets())); _inspector = new Inspector.Inspector(this); _isLoaded = true; }