private void Water() { EditorGUI.BeginChangeCheck(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Water Preset", EditorStyles.boldLabel, GUILayout.Width(105f)); m_gaiaSettings.m_gaiaWaterProfile.m_selectedWaterProfileValuesIndex = EditorGUILayout.Popup(m_gaiaSettings.m_gaiaWaterProfile.m_selectedWaterProfileValuesIndex, WaterList.ToArray()); if (GUILayout.Button("Edit")) { GaiaUtils.FocusWaterProfile(); } EditorGUILayout.EndHorizontal(); if (EditorGUI.EndChangeCheck()) { Material waterMat = GaiaWater.GetGaiaOceanMaterial(); GaiaUtils.GetRuntimeSceneObject(); if (GaiaGlobal.Instance != null) { GaiaWater.GetProfile(m_gaiaSettings.m_gaiaWaterProfile.m_selectedWaterProfileValuesIndex, waterMat, GaiaGlobal.Instance.SceneProfile, true, false); } } }
private void GlobalSettingsPanel(bool helpEnabled) { if (Application.isPlaying) { LoadFromApplicationPlaying(); } m_editorUtils.Text("GaiaRuntimeInfo"); EditorGUILayout.Space(); m_profile.m_mainCamera = (Camera)m_editorUtils.ObjectField("MainCamera", m_profile.m_mainCamera, typeof(Camera), true, helpEnabled); if (m_profile.SceneProfile != null) { EditorGUI.BeginChangeCheck(); EditorGUILayout.BeginHorizontal(); m_profile.SceneProfile.m_lightSystemMode = (GaiaConstants.GlobalSystemMode)m_editorUtils.EnumPopup("LightingSystemMode", m_profile.SceneProfile.m_lightSystemMode); if (m_profile.SceneProfile.m_lightSystemMode == GaiaConstants.GlobalSystemMode.Gaia) { if (m_profile.SceneProfile.m_lightingProfiles.Count > 0) { if (m_editorUtils.Button("AdvancedLightingSettings", GUILayout.MaxWidth(170f))) { GaiaLighting.FocusGaiaLightingProfile(); } } } else if (m_profile.SceneProfile.m_lightSystemMode == GaiaConstants.GlobalSystemMode.ThirdParty) { if (m_editorUtils.Button("AdvancedLightingSettings", GUILayout.MaxWidth(170f))) { GaiaLighting.FocusGaiaLightingProfile(); } /*if (m_profile.SceneProfile.m_thirdPartyLightObject != null) * { * if (m_editorUtils.Button("EditThirdParty", GUILayout.MaxWidth(170f))) * { * Selection.activeObject = m_profile.SceneProfile.m_thirdPartyLightObject; * } * } * else * { * if (m_editorUtils.Button("AdvancedLightingSettings", GUILayout.MaxWidth(170f))) * { * GaiaLighting.FocusGaiaLightingProfile(); * } * }*/ } EditorGUILayout.EndHorizontal(); m_editorUtils.InlineHelp("LightingSystemMode", helpEnabled); if (m_profile.SceneProfile.m_lightSystemMode == GaiaConstants.GlobalSystemMode.Gaia) { if (m_profile.SceneProfile.m_lightingProfiles.Count < 1) { EditorGUILayout.HelpBox("No lighting data has been set you can go to Gaia Manager and click step 2 to create skies and water or you can go to Save and Load and click Revert To Defaults to load the skies and water data.", MessageType.Info); } } else if (m_profile.SceneProfile.m_lightSystemMode == GaiaConstants.GlobalSystemMode.ThirdParty) { if (m_profile.SceneProfile.m_thirdPartyLightObject == null) { EditorGUILayout.HelpBox("No Lighting System has been set, open 'Advanced Lighting Settings' to setup", MessageType.Info); } } else { EditorGUILayout.HelpBox("Lighting System Mode is set to 'None' to use light set the mode to 'Gaia or ThirdParty'", MessageType.Info); } EditorGUILayout.BeginHorizontal(); m_profile.SceneProfile.m_waterSystemMode = (GaiaConstants.GlobalSystemMode)m_editorUtils.EnumPopup("WaterSystemMode", m_profile.SceneProfile.m_waterSystemMode); if (m_profile.SceneProfile.m_waterSystemMode == GaiaConstants.GlobalSystemMode.Gaia) { if (m_profile.SceneProfile.m_waterProfiles.Count > 0) { if (m_editorUtils.Button("AdvancedWaterSettings", GUILayout.MaxWidth(170f))) { GaiaUtils.FocusWaterProfile(); } } } else if (m_profile.SceneProfile.m_waterSystemMode == GaiaConstants.GlobalSystemMode.ThirdParty) { if (m_editorUtils.Button("AdvancedWaterSettings", GUILayout.MaxWidth(170f))) { GaiaUtils.FocusWaterProfile(); } /*if (m_profile.SceneProfile.m_thirdPartyWaterObject != null) * { * if (m_editorUtils.Button("EditThirdParty", GUILayout.MaxWidth(170f))) * { * Selection.activeObject = m_profile.SceneProfile.m_thirdPartyLightObject; * } * } * else * { * if (m_editorUtils.Button("AdvancedWaterSettings", GUILayout.MaxWidth(170f))) * { * GaiaUtils.FocusWaterProfile(); * } * }*/ } EditorGUILayout.EndHorizontal(); m_editorUtils.InlineHelp("WaterSystemMode", helpEnabled); if (m_profile.SceneProfile.m_waterSystemMode == GaiaConstants.GlobalSystemMode.Gaia) { if (m_profile.SceneProfile.m_lightingProfiles.Count < 1) { EditorGUILayout.HelpBox("No lighting data has been set you can go to Gaia Manager and click step 2 to create skies and water or you can go to Save and Load and click Revert To Defaults to load the skies and water data.", MessageType.Info); } } else if (m_profile.SceneProfile.m_waterSystemMode == GaiaConstants.GlobalSystemMode.ThirdParty) { if (m_profile.SceneProfile.m_thirdPartyWaterObject == null) { EditorGUILayout.HelpBox("No Water System has been set, open 'Advanced Water Settings' to setup", MessageType.Info); } } else { EditorGUILayout.HelpBox("Water System Mode is set to 'None' to use light set the mode to 'Gaia or ThirdParty'", MessageType.Info); } if (EditorGUI.EndChangeCheck()) { EditorUtility.SetDirty(m_profile); Undo.RecordObject(m_profile, "Changes Made"); m_profile.UpdateGaiaTimeOfDay(false); m_profile.UpdateGaiaWeather(); } m_editorUtils.Panel("SaveAndLoad", SaveAndLoad); } }