public void SetState(SceneProfile profile, bool state) { if (profile == null) { return; } profile.m_enableReflections = state; profile.m_enableDisabeHeightFeature = state; #if UPPipeline if (m_planarReflections != null) { m_planarReflections.SetReflectionState(state); } else { m_planarReflections = GameObject.FindObjectOfType <GaiaPlanarReflections>(); if (m_planarReflections != null) { m_planarReflections.SetReflectionState(state); } } #endif }
public static void ConvertProfileToHDRP(SceneProfile lightingProfile, GaiaLightingProfileValues profile, bool convertToNewProfile = false) { try { if (GaiaUtils.GetActivePipeline() != GaiaConstants.EnvironmentRenderer.HighDefinition) { Debug.Log("Need to be using High Definition render pipeline to use this function"); return; } GaiaLightingProfileValues profileValue = profile; if (convertToNewProfile) { GaiaLightingProfileValues newProfileValues = new GaiaLightingProfileValues(); GaiaUtils.CopyFields(profile, newProfileValues); profileValue = newProfileValues; lightingProfile.m_lightingProfiles.Add(profileValue); profileValue.m_typeOfLighting = "Converted HDRP Profile " + (lightingProfile.m_lightingProfiles.Count - 1); lightingProfile.m_selectedLightingProfileValuesIndex = lightingProfile.m_lightingProfiles.Count - 1; } if (EditorUtility.DisplayDialog("Convert Sun", "Would you like to convert the Sun Values", "Yes", "No")) { ConvertSun(profileValue, GaiaConstants.EnvironmentRenderer.HighDefinition); } //ConvertPWWeather(profileValue, GaiaConstants.EnvironmentRenderer.HighDefinition); } catch (Exception e) { Console.WriteLine(e); throw; } }
public override void OnInspectorGUI() { //Initialization m_editorUtils.Initialize(); // Do not remove this! if (m_profile != null) { //Monitor for changes EditorGUI.BeginChangeCheck(); if (m_gaiaSettings == null) { m_gaiaSettings = GaiaUtils.GetGaiaSettings(); } m_editorUtils.Panel("GlobalSettings", GlobalSettings, false, true, true); //Check for changes, make undo record, make changes and let editor know we are dirty if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(m_profile, "Made changes"); EditorUtility.SetDirty(m_profile); } } else { if (GaiaGlobal.Instance != null) { m_profile = GaiaGlobal.Instance.SceneProfile; } } }
public void Set(SceneProfile profile) { if (profile == null) { return; } profile.m_enableReflections = m_enableReflections; profile.m_allowMSAA = m_allowMSAA; profile.m_useHDR = m_enableHDR; profile.m_enableDisabeHeightFeature = m_enableHeightFeatures; profile.m_disableHeight = m_disableHeightValue; profile.m_useCustomRenderDistance = m_enableCustomDistance; profile.m_enableLayerDistances = m_enableMultiLayerDistances; profile.m_customRenderDistance = m_reflectionDistance; profile.m_customRenderDistances = m_reflectionDistances; }
public override void OnInspectorGUI() { if (m_profile == null) { m_profile = (SceneProfile)target; } m_helpBoxStyle = SetupHelpBoxStyle(); EditorGUILayout.LabelField(m_sceneProfileContext1 + "<b>" + m_profile.m_savedFromScene + "</b>" + m_sceneProfileContext2, m_helpBoxStyle); if (GUILayout.Button(new GUIContent("Open Source Scene", "This will open the scene where this profile was created from. The scene where this was saved from is shown in Bold in the text above."))) { string sceneToOpen = GaiaUtils.GetAssetPath(m_profile.m_savedFromScene + ".unity"); if (!string.IsNullOrEmpty(sceneToOpen)) { LoadSourceScene(sceneToOpen); } } }
public void OnEnable() { //Get Gaia Lighting Profile object if (GaiaGlobal.Instance != null) { m_profile = GaiaGlobal.Instance.SceneProfile; } if (m_editorUtils == null) { // Get editor utils for this m_editorUtils = PWApp.GetEditorUtils(this); } if (m_gaiaSettings == null) { m_gaiaSettings = GaiaUtils.GetGaiaSettings(); } }
public void Process(SceneProfile sceneProfile, bool state) { Get(sceneProfile); SetState(sceneProfile, state); }