Esempio n. 1
0
        private void LocationManagerSettings(bool helpEnabled)
        {
            if (m_gaiaSettings != null)
            {
                EditorGUI.BeginChangeCheck();
                m_gaiaSettings.m_enableLocationManager = m_editorUtils.Toggle("EnableLocationManager", m_gaiaSettings.m_enableLocationManager, helpEnabled);
                if (m_gaiaSettings.m_enableLocationManager)
                {
                    m_editorUtils.Text("LocationManagerInfo");
                    if (m_editorUtils.Button("OpenLocationManager"))
                    {
                        LocationManagerEditor.ShowLocationManager();
                    }
                }

                if (EditorGUI.EndChangeCheck())
                {
                    if (m_gaiaSettings.m_enableLocationManager)
                    {
                        LocationManagerEditor.AddLocationSystem();
                    }
                    else
                    {
                        LocationManagerEditor.RemoveLocationSystem();
                    }
                }
            }
        }
Esempio n. 2
0
        public override void WelcomeGUI()
        {
            if (m_editorUtils == null)
            {
                m_editorUtils = PWApp.GetEditorUtils(this);
            }
            m_editorUtils.Initialize();
            m_editorUtils.GUIHeader();

            m_editorUtils.Title("Welcome title");

            EditorGUILayout.Space();
            m_editorUtils.Text("Welcome message");

            GUILayout.Space(10f);
            if (m_editorUtils.ButtonCentered("Open Quick Start Button", GUILayout.Width(250f)))
            {
                Application.OpenURL("http://www.procedural-worlds.com/gaia/?section=tutorials");
            }
        }
Esempio n. 3
0
        private void DrawOperations(bool helpEnabled)
        {
            if (m_manager.m_session == null)
            {
                return;
            }
            if (m_manager.m_session.m_operations.Count > 0)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Space(8);
                bool oldSelectAll = m_manager.m_selectAllOperations;
                m_manager.m_selectAllOperations = m_editorUtils.Toggle(m_manager.m_selectAllOperations, m_editorUtils.GetContent("SelectAllToolTip"));

                if (m_manager.m_selectAllOperations != oldSelectAll)
                {
                    foreach (GaiaOperation op in m_manager.m_session.m_operations)
                    {
                        op.m_isActive = m_manager.m_selectAllOperations;
                    }
                }
                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();
            }
            else
            {
                GUILayout.BeginHorizontal();
                GUILayout.Space(50);
                GUILayout.FlexibleSpace();
                m_editorUtils.Text("NoOperationsYet");
                GUILayout.FlexibleSpace();
                GUILayout.Space(50);
                GUILayout.EndHorizontal();
            }
            //Extra indent needed to draw the foldouts in the correct position
            EditorGUI.indentLevel++;
            bool currentGUIState = GUI.enabled;

            for (int i = 0; i < m_manager.m_session.m_operations.Count; i++)
            {
                GaiaOperation op          = m_manager.m_session.m_operations[i];
                GUIStyle      headerStyle = m_operationCreateWorldStyle;

                switch (op.m_operationType)
                {
                case GaiaOperation.OperationType.CreateWorld:
                    headerStyle = m_operationCreateWorldStyle;
                    break;

                case GaiaOperation.OperationType.ClearSpawns:
                    headerStyle = m_operationClearSpawnsStyle;
                    break;

                case GaiaOperation.OperationType.FlattenTerrain:
                    headerStyle = m_operationFlattenTerrainStyle;
                    break;

                case GaiaOperation.OperationType.RemoveNonBiomeResources:
                    headerStyle = m_operationRemoveNonBiomeResourcesStyle;
                    break;

                case GaiaOperation.OperationType.Spawn:
                    headerStyle = m_operationSpawnStyle;
                    break;

                case GaiaOperation.OperationType.Stamp:
                    headerStyle = m_operationStampStyle;
                    break;

                case GaiaOperation.OperationType.StampUndo:
                    headerStyle = m_operationStampUndoRedoStyle;
                    break;

                case GaiaOperation.OperationType.StampRedo:
                    headerStyle = m_operationStampUndoRedoStyle;
                    break;

                case GaiaOperation.OperationType.MaskMapExport:
                    headerStyle = m_operationMaskMapExportStyle;
                    break;
                }
                GUI.enabled = op.m_isActive;
                GUILayout.BeginHorizontal(headerStyle);
                GUI.enabled      = currentGUIState;
                op.m_isActive    = GUILayout.Toggle(op.m_isActive, "", m_operationCheckboxStyle);
                GUI.enabled      = op.m_isActive;
                op.m_isFoldedOut = m_editorUtils.Foldout(op.m_isFoldedOut, new GUIContent((i + 1).ToString() + " " + op.m_description.ToString()), true, m_operationFoldOutStyle);
                GUILayout.EndHorizontal();
                GUI.enabled = currentGUIState;

                if (op.m_isFoldedOut)
                {
                    DrawOperationFields(op, m_editorUtils, m_manager, helpEnabled, i);
                }
                GUILayout.Space(2);
            }
            EditorGUI.indentLevel--;
        }
Esempio n. 4
0
        private void DetailTerrainDistance(bool helpEnabled)
        {
            EditorGUI.BeginChangeCheck();

            m_editorUtils.Text("DetailInfo");
            EditorGUILayout.Space();

            //switch (m_profile.m_detailQuality)
            //{
            //    case GaiaConstants.TerrainDetailQuality.Ultra2:
            //        EditorGUILayout.LabelField(m_editorUtils.GetTextValue("DetailPatchResolution") + "Ultra");
            //        break;
            //    case GaiaConstants.TerrainDetailQuality.VeryHigh4:
            //        EditorGUILayout.LabelField(m_editorUtils.GetTextValue("DetailPatchResolution") + "Very High");
            //        break;
            //    case GaiaConstants.TerrainDetailQuality.High8:
            //        EditorGUILayout.LabelField(m_editorUtils.GetTextValue("DetailPatchResolution") + "High");
            //        break;
            //    case GaiaConstants.TerrainDetailQuality.Medium16:
            //        EditorGUILayout.LabelField(m_editorUtils.GetTextValue("DetailPatchResolution") + "Medium");
            //        break;
            //    case GaiaConstants.TerrainDetailQuality.Low32:
            //        EditorGUILayout.LabelField(m_editorUtils.GetTextValue("DetailPatchResolution") + "Low");
            //        break;
            //    case GaiaConstants.TerrainDetailQuality.VeryLow64:
            //        EditorGUILayout.LabelField(m_editorUtils.GetTextValue("DetailPatchResolution") + "Very Low");
            //        break;
            //}
            //EditorGUILayout.HelpBox(m_editorUtils.GetTextValue("DetailPatchResolutionHelp"), MessageType.Info);

            m_profile.m_detailDistance = m_editorUtils.IntField("DetailDistance", m_profile.m_detailDistance, helpEnabled);
            if (m_profile.m_detailDistance < 0)
            {
                m_profile.m_detailDistance = 0;
            }
            if (m_profile.m_detailDistance > 250)
            {
                EditorGUILayout.HelpBox(m_editorUtils.GetTextValue("DetailDistanceHelp"), MessageType.Info);
            }

            m_profile.m_detailDensity = m_editorUtils.Slider("DetailDensity", m_profile.m_detailDensity, 0f, 1f, helpEnabled);
            if (m_profile.m_detailDistance > 250 && m_profile.m_detailDensity > 0.5f)
            {
                EditorGUILayout.HelpBox(m_editorUtils.GetTextValue("DetailDensityHelp"), MessageType.Info);
            }

            if (m_editorUtils.Button("ApplyToAll"))
            {
                m_profile.ApplySettings(true);
            }

            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(m_profile, "Made changes");
                EditorUtility.SetDirty(m_profile);
                m_profile.ApplySettings(false);

                if (!Application.isPlaying)
                {
                    EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene());
                }
            }
        }
Esempio n. 5
0
        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);
            }
        }