예제 #1
0
        public override void OnInspectorGUI()
        {
            //Initialization
            m_editorUtils.Initialize(); // Do not remove this!

            m_editorUtils.Panel("SimpleLayerCulling", SimpleLayerCulling, true);
        }
예제 #2
0
        public override void OnInspectorGUI()
        {
            //Initialization
            m_editorUtils.Initialize(); // Do not remove this!

            if (m_profile == null)
            {
                //Get GaiaHierarchyUtils Profile object
                m_profile = (GaiaHierarchyUtils)target;
            }

            //Monitor for changes
            EditorGUI.BeginChangeCheck();

            m_editorUtils.Panel("GlobalSettings", GlobalSettings, 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);

                m_profile.SetupHideInHierarchy();
                m_settingsChangedInfo = true;
            }
        }
예제 #3
0
        public override void OnInspectorGUI()
        {
            if (dropdownGUIStyle == null)
            {
                dropdownGUIStyle = new GUIStyle(EditorStyles.popup)
                {
                    fixedHeight = 16f, margin = new RectOffset(0, 0, 4, 0)
                };
            }

            if (m_profile != null)
            {
                Transform transform = m_profile.gameObject.transform;
                transform.hideFlags = HideFlags.HideInInspector | HideFlags.NotEditable;
                if (m_profile.m_mainCamera == null)
                {
                    m_profile.m_mainCamera = GaiaUtils.GetCamera();
                }
            }

            //Initialization
            m_editorUtils.Initialize(); // Do not remove this!
            if (m_gaiaSettings == null)
            {
                m_gaiaSettings = GaiaUtils.GetGaiaSettings();
            }

            m_editorUtils.Panel("GlobalSettings", GlobalSettingsPanel, false, true, true);
        }
예제 #4
0
        public override void OnInspectorGUI()
        {
            m_editorUtils.Initialize(); // Do not remove this!
            m_spawnerSettings = (SpawnerSettings)target;

            string message = m_editorUtils.GetTextValue("Intro");;

            EditorGUILayout.HelpBox(message, MessageType.Info, true);

            if (GUILayout.Button(m_editorUtils.GetContent("AddToScene")))
            {
                m_spawnerSettings.CreateSpawner();
            }

            GUILayout.Label(m_editorUtils.GetContent("SpawnRulePreview"), m_editorUtils.Styles.heading);

            GaiaResource resource = m_spawnerSettings.m_resources;// (GaiaResource)AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(m_spawnerSettings.m_resourcesGUID), typeof(GaiaResource));

            foreach (SpawnRule rule in m_spawnerSettings.m_spawnerRules)
            {
                m_editorUtils.LabelField("Name", new GUIContent(rule.m_name));
                m_editorUtils.LabelField("Type", new GUIContent(rule.m_resourceType.ToString()));


                Texture2D resourceTexture = SpawnerEditor.GetSpawnRulePreviewTexture(rule, resource);

                if (resourceTexture != null)
                {
                    m_editorUtils.Image(resourceTexture, 100, 100);
                }
            }
        }
예제 #5
0
        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;
                }
            }
        }
예제 #6
0
        public override void OnInspectorGUI()
        {
            if (redStyle == null || redStyle.normal.background == null || greenStyle == null || greenStyle.normal.background == null)
            {
                redStyle = new GUIStyle();
                redStyle.normal.background = GaiaUtils.GetBGTexture(Color.red, m_tempTextureList);

                greenStyle = new GUIStyle();
                greenStyle.normal.background = GaiaUtils.GetBGTexture(Color.green, m_tempTextureList);
            }


            //Init editor utils
            if (m_editorUtils == null)
            {
                // Get editor utils for this
                m_editorUtils = PWApp.GetEditorUtils(this);
            }
            m_editorUtils.Initialize(); // Do not remove this!
            if (GaiaUtils.HasDynamicLoadedTerrains())
            {
                m_editorUtils.Panel("GeneralSettings", DrawGeneralSettings, true);
                m_editorUtils.Panel("LoaderPanel", DrawLoaders, false);
                m_editorUtils.Panel("PlaceholderPanel", DrawTerrains, false);
            }
            else
            {
                EditorGUILayout.HelpBox(m_editorUtils.GetTextValue("NoTerrainLoadingMessage"), MessageType.Info);
            }
        }
예제 #7
0
        public override void OnInspectorGUI()
        {
            //Initialization
            m_editorUtils.Initialize(); // Do not remove this!

            m_editorUtils.Panel("GlobalSettings", GlobalSettings, false, true, true);
        }
예제 #8
0
        public void OnGUI()
        {
            //Initialization
            m_editorUtils.Initialize(); // Do not remove this!
            scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition, GUILayout.Width(position.width), GUILayout.Height(position.height));

            //Set up the box style
            if (m_boxStyle == null)
            {
                m_boxStyle = new GUIStyle(GUI.skin.box)
                {
                    normal    = { textColor = GUI.skin.label.normal.textColor },
                    fontStyle = FontStyle.Bold,
                    alignment = TextAnchor.UpperLeft
                };
            }

            if (m_profile == null)
            {
                m_profile = GetLocationSystem();
            }

            m_editorUtils.Panel("GlobalSettings", GlobalPanel, true);

            EditorGUILayout.EndScrollView();
        }
예제 #9
0
        public override void OnInspectorGUI()
        {
            //Initialization
            m_editorUtils.Initialize(); // Do not remove this!
            m_profile = (PWSkyPostProcessingManager)target;

            m_editorUtils.Panel("GlobalSettings", GlobalSettings, true);
        }
예제 #10
0
        public override void OnInspectorGUI()
        {
            m_editorUtils.Initialize();
            if (m_bufferManager == null)
            {
                m_bufferManager = (CommandBufferManager)target;
            }

            m_editorUtils.Panel("GlobalSettings", GlobalPanel, true);
        }
예제 #11
0
        public override void OnInspectorGUI()
        {
            //Initialization
            m_editorUtils.Initialize(); // Do not remove this!

            m_profile.GetResolutionPatches();

            EditorGUILayout.LabelField("Version: " + m_version);

            m_editorUtils.Panel("DetailDistanceSettings", DetailTerrainDistance, true);
        }
예제 #12
0
        public override void OnInspectorGUI()
        {
            //Initialization
            m_editorUtils.Initialize(); // Do not remove this!
            if (m_profile == null)
            {
                m_profile = (ReflectionMasker)target;
            }

            m_editorUtils.Panel("GlobalSettings", GlobalSettings, true);
        }
예제 #13
0
        public override void OnInspectorGUI()
        {
            //Initialization
            m_editorUtils.Initialize(); // Do not remove this!

            if (m_profile == null)
            {
                m_profile = (DisableUnderwaterFXTrigger)target;
            }

            m_editorUtils.Panel("GlobalSettings", GlobalPanel, true);
        }
예제 #14
0
        public override void OnInspectorGUI()
        {
            m_editorUtils.Initialize(); // Do not remove this!
            m_biomePreset = (BiomePreset)target;
            serializedObject.Update();

            m_editorUtils.Panel("BiomeSettings", DrawBiomeSettings, true);

            if (GUILayout.Button(m_editorUtils.GetContent("AddToScene")))
            {
                BiomeController newBiome = m_biomePreset.CreateBiome(true);
                Selection.activeGameObject = newBiome.gameObject;
            }
        }
예제 #15
0
        public override void OnInspectorGUI()
        {
            //Initialization
            m_editorUtils.Initialize(); // Do not remove this!

            EditorGUI.BeginChangeCheck();

            m_editorUtils.Panel("GlobalSettings", GlobalSettings, 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);
            }
        }
예제 #16
0
        public override void OnInspectorGUI()
        {
            m_editorUtils.Initialize(); // Do not remove this!
            m_worldMap = (WorldMap)target;
            serializedObject.Update();

            if (m_worldMap.m_worldMapTerrain == null)
            {
                m_editorUtils.Panel("CreateWorldMap", CreateWorldMap, true);
            }
            else
            {
                m_editorUtils.Panel("CreateWorldMap", CreateWorldMap, false);
                m_editorUtils.Panel("EditWorldMap", DrawEditWorldMap, true);
                m_editorUtils.Panel("SyncHeightmap", DrawSyncHeightmap, true);
            }
        }
예제 #17
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");
            }
        }
예제 #18
0
        public override void OnInspectorGUI()
        {
            m_scanner = (Scanner)target;

            m_editorUtils.Initialize(); // Do not remove this!

            //Set up the box style
            if (m_boxStyle == null)
            {
                m_boxStyle = new GUIStyle(EditorStyles.helpBox)
                {
                    normal    = { textColor = GUI.skin.label.normal.textColor },
                    fontStyle = FontStyle.Bold,
                    fontSize  = GUI.skin.label.fontSize,
                    alignment = TextAnchor.UpperLeft
                };
            }

            if (m_dropBoxStyle == null)
            {
                m_dropBoxStyle = new GUIStyle(GUI.skin.box)
                {
                    fontStyle = FontStyle.Bold,
                    alignment = TextAnchor.MiddleCenter
                };
            }

            //Setup the wrap style
            if (m_wrapStyle == null)
            {
                m_wrapStyle = new GUIStyle(GUI.skin.label)
                {
                    fontStyle = FontStyle.Normal, wordWrap = true
                };
            }

            m_editorUtils.Panel("GlobalSettings", GlobalPanel, true);
        }
예제 #19
0
        public override void OnInspectorGUI()
        {
            m_editorUtils.Initialize(); // Do not remove this!

            m_orderBy           = (GaiaStopwatchOrderBy)m_editorUtils.EnumPopup("OrderBy", m_orderBy);
            m_orderbyDescending = m_editorUtils.Toggle("Descending", m_orderbyDescending);
            switch (m_orderBy)
            {
            case GaiaStopwatchOrderBy.FirstStart:
                m_orderByLambda = x => x.m_firstStartTimeStamp;
                break;

            case GaiaStopwatchOrderBy.Name:
                m_orderByLambda = x => x.m_name;
                break;

            case GaiaStopwatchOrderBy.TotalDuration:
                m_orderByLambda = x => x.m_accumulatedTime;
                break;
            }

            List <GaiaStopWatchEvent> relevantEvents;

            if (m_orderbyDescending)
            {
                relevantEvents = m_gaiastopwatchDataset.m_events.FindAll(x => x.m_parent == "" || x.m_parent == null).OrderByDescending(m_orderByLambda).ToList();
            }
            else
            {
                relevantEvents = m_gaiastopwatchDataset.m_events.FindAll(x => x.m_parent == "" || x.m_parent == null).OrderBy(m_orderByLambda).ToList();
            }

            foreach (GaiaStopWatchEvent stopWatchEvent in relevantEvents)
            {
                DrawStopwatchEvent(stopWatchEvent);
            }
        }
예제 #20
0
        public override void OnInspectorGUI()
        {
#if GAIA_PRO_PRESENT
            m_editorUtils.Initialize(); // Do not remove this!
            m_maskMapExportSettings = (MaskMapExportSettings)target;

            string message = m_editorUtils.GetTextValue("Intro");;
            EditorGUILayout.HelpBox(message, MessageType.Info, true);
            if (m_editorUtils.Button("AddToScene"))
            {
                GameObject sessionTempObj     = GaiaUtils.GetTempSessionToolsObject();
                GameObject maskMapExporterObj = new GameObject("Mask Map Exporter");
                maskMapExporterObj.transform.parent = sessionTempObj.transform;
                MaskMapExport maskMapExport = maskMapExporterObj.AddComponent <MaskMapExport>();
                maskMapExport.LoadSettings(m_maskMapExportSettings);
            }
            m_editorUtils.Heading("Stored Settings");
            DrawDefaultInspector();
            // Update is called once per frame
#else
            string message = m_editorUtils.GetTextValue("GaiaProInfo");;
            EditorGUILayout.HelpBox(message, MessageType.Info, true);
#endif
        }
예제 #21
0
        public override void OnInspectorGUI()
        {
            m_editorUtils.Initialize(); // Do not remove this!

#if GAIA_DEBUG
            if (m_editorUtils.Button("DisableStopwatch"))
            {
                bool   isChanged         = false;
                string currBuildSettings = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
                if (currBuildSettings.Contains("GAIA_DEBUG"))
                {
                    currBuildSettings = currBuildSettings.Replace("GAIA_DEBUG;", "");
                    currBuildSettings = currBuildSettings.Replace("GAIA_DEBUG", "");
                    isChanged         = true;
                }
                if (isChanged)
                {
                    PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, currBuildSettings);
                }
            }
            if (!GaiaStopwatch.m_isEnabled)
            {
                if (m_editorUtils.Button("StartStopwatch"))
                {
                    GaiaStopwatch.m_isEnabled = true;
                }
            }
            else
            {
                if (m_editorUtils.Button("StopStopwatch"))
                {
                    GaiaStopwatch.Stop();
                }
            }
#else
            if (m_editorUtils.Button("EnableStopwatch"))
            {
                bool   isChanged         = false;
                string currBuildSettings = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
                if (!currBuildSettings.Contains("GAIA_DEBUG"))
                {
                    if (string.IsNullOrEmpty(currBuildSettings))
                    {
                        currBuildSettings = "GAIA_DEBUG";
                    }
                    else
                    {
                        currBuildSettings += ";GAIA_DEBUG";
                    }
                    isChanged = true;
                }
                if (isChanged)
                {
                    PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, currBuildSettings);
                }
            }

            GUI.enabled = false;
            m_editorUtils.Button("StartStopwatch");
#endif
        }
예제 #22
0
 void OnGUI()
 {
     m_editorUtils.Initialize();
     m_editorUtils.Panel("SelectStampPanel", SelectStampPanel, true);
 }
예제 #23
0
 public override void OnInspectorGUI()
 {
     m_editorUtils.Initialize(); // Do not remove this!
     m_editorUtils.Panel("UserFiles", DrawUserFiles, true);
 }
예제 #24
0
        public override void OnInspectorGUI()
        {
            //Get our stamper
            m_stamper = (Stamper)target;

            //Init editor utils
            m_editorUtils.Initialize();

            //Set up the box style
            if (m_boxStyle == null)
            {
                m_boxStyle = new GUIStyle(GUI.skin.box);
                m_boxStyle.normal.textColor = GUI.skin.label.normal.textColor;
                m_boxStyle.fontStyle        = FontStyle.Bold;
                m_boxStyle.alignment        = TextAnchor.UpperLeft;
            }

            //Setup the wrap style
            if (m_wrapStyle == null)
            {
                m_wrapStyle          = new GUIStyle(GUI.skin.label);
                m_wrapStyle.wordWrap = true;
            }

            //Draw the intro
            m_editorUtils.DrawIntro("Stamper", "The stamper allows you to stamp features into your terrain. Click here to see a tutorial.", "http://www.procedural-worlds.com/gaia/tutorials/stamper-introduction/");

            //Disable if spawning
            if (m_stamper.m_stampComplete != true && !m_stamper.m_cancelStamp)
            {
                GUI.enabled = false;
            }

            EditorGUI.BeginChangeCheck();

            GUILayout.BeginVertical("Operations:", m_boxStyle);
            GUILayout.Space(20);
            Texture2D    feature   = (Texture2D)EditorGUILayout.ObjectField(GetLabel("Stamp Preview"), m_stamper.m_stampPreviewImage, typeof(Texture2D), false);
            GaiaResource resources = (GaiaResource)EditorGUILayout.ObjectField(GetLabel("Resources"), m_stamper.m_resources, typeof(GaiaResource), false);

            Gaia.GaiaConstants.FeatureOperation operation = (Gaia.GaiaConstants.FeatureOperation)EditorGUILayout.EnumPopup(GetLabel("Operation Type"), m_stamper.m_stampOperation);
            float stencilHeight = m_stamper.m_stencilHeight;

            if (operation == GaiaConstants.FeatureOperation.StencilHeight)
            {
                stencilHeight = EditorGUILayout.Slider(GetLabel("Stencil Height"), m_stamper.m_stencilHeight, -1000f, 1000f);
            }
            float blendStrength = m_stamper.m_blendStrength;

            if (operation == GaiaConstants.FeatureOperation.BlendHeight)
            {
                blendStrength = EditorGUILayout.Slider(GetLabel("Blend Strength"), m_stamper.m_blendStrength, 0f, 1f);
            }
            //GUILayout.Label(stamper.m_feature, GUILayout.Width(200f), GUILayout.Height(200f) );
            AnimationCurve heightModifier   = EditorGUILayout.CurveField(GetLabel("Transform Height"), m_stamper.m_heightModifier);
            int            smoothIterations = m_stamper.m_smoothIterations = EditorGUILayout.IntSlider(GetLabel("Smooth Stamp"), m_stamper.m_smoothIterations, 0, 10);
            bool           normaliseStamp   = EditorGUILayout.Toggle(GetLabel("Normalise Stamp"), m_stamper.m_normaliseStamp);
            bool           invertStamp      = EditorGUILayout.Toggle(GetLabel("Invert Stamp"), m_stamper.m_invertStamp);

            GUILayout.EndVertical();

            GUILayout.BeginVertical("Position, Rotate and Scale:", m_boxStyle);
            GUILayout.Space(20);
            //GUILayout.Label("Operation:", EditorStyles.boldLabel);
            float x = EditorGUILayout.Slider(GetLabel("Position X"), m_stamper.m_x, m_minX, m_maxX);
            float y = m_stamper.m_y;

            if (!m_stamper.m_stickBaseToGround)
            {
                y = EditorGUILayout.Slider(GetLabel("Position Y"), m_stamper.m_y, m_minY, m_maxY);
            }
            float z                 = EditorGUILayout.Slider(GetLabel("Position Z"), m_stamper.m_z, m_minZ, m_maxZ);
            float rotation          = EditorGUILayout.Slider(GetLabel("Rotation"), m_stamper.m_rotation, -180f, 180f);
            float width             = EditorGUILayout.Slider(GetLabel("Width"), m_stamper.m_width, 0.1f, 200f);
            float height            = EditorGUILayout.Slider(GetLabel("Height"), m_stamper.m_height, 0.1f, 100f);
            float baseLevel         = EditorGUILayout.Slider(GetLabel("Base Level"), m_stamper.m_baseLevel, 0f, 1f);
            bool  stickBaseToGround = EditorGUILayout.Toggle(GetLabel("Ground Base"), m_stamper.m_stickBaseToGround);
            bool  stampBase         = EditorGUILayout.Toggle(GetLabel("Stamp Base"), m_stamper.m_drawStampBase);
            bool  showBase          = EditorGUILayout.Toggle(GetLabel("Show Base"), m_stamper.m_showBase);

            GUILayout.EndVertical();

            GUILayout.BeginVertical("Masks:", m_boxStyle);
            GUILayout.Space(20);
            //GUILayout.Label("Masks:", EditorStyles.boldLabel);
            AnimationCurve distanceMask = EditorGUILayout.CurveField(GetLabel("Distance Mask"), m_stamper.m_distanceMask);

            Gaia.GaiaConstants.ImageFitnessFilterMode areaMaskMode = (Gaia.GaiaConstants.ImageFitnessFilterMode)EditorGUILayout.EnumPopup(GetLabel("Area Mask"), m_stamper.m_areaMaskMode);
            Texture2D imageMask          = m_stamper.m_imageMask;
            bool      imageMaskInvert    = m_stamper.m_imageMaskInvert;
            bool      imageMaskNormalise = m_stamper.m_imageMaskNormalise;
            bool      imageMaskFlip      = m_stamper.m_imageMaskFlip;

            float noiseMaskSeed        = m_stamper.m_noiseMaskSeed;
            int   noiseMaskOctaves     = m_stamper.m_noiseMaskOctaves;
            float noiseMaskPersistence = m_stamper.m_noiseMaskPersistence;
            float noiseMaskFrequency   = m_stamper.m_noiseMaskFrequency;
            float noiseMaskLacunarity  = m_stamper.m_noiseMaskLacunarity;
            float noiseZoom            = m_stamper.m_noiseZoom;

            int imageMaskSmoothIterations = m_stamper.m_imageMaskSmoothIterations;

            if (areaMaskMode == GaiaConstants.ImageFitnessFilterMode.ImageAlphaChannel ||
                areaMaskMode == GaiaConstants.ImageFitnessFilterMode.ImageBlueChannel ||
                areaMaskMode == GaiaConstants.ImageFitnessFilterMode.ImageGreenChannel ||
                areaMaskMode == GaiaConstants.ImageFitnessFilterMode.ImageGreyScale ||
                areaMaskMode == GaiaConstants.ImageFitnessFilterMode.ImageRedChannel)
            {
                imageMask = (Texture2D)EditorGUILayout.ObjectField(GetLabel("Image Mask"), m_stamper.m_imageMask, typeof(Texture2D), false);
            }
            else if (areaMaskMode == GaiaConstants.ImageFitnessFilterMode.PerlinNoise || areaMaskMode == GaiaConstants.ImageFitnessFilterMode.RidgedNoise ||
                     areaMaskMode == GaiaConstants.ImageFitnessFilterMode.BillowNoise)
            {
                noiseMaskSeed        = EditorGUILayout.Slider(GetLabel("Noise Seed"), noiseMaskSeed, 0f, 65000f);
                noiseMaskOctaves     = EditorGUILayout.IntSlider(GetLabel("Octaves"), noiseMaskOctaves, 1, 12);
                noiseMaskPersistence = EditorGUILayout.Slider(GetLabel("Persistence"), noiseMaskPersistence, 0f, 1f);
                noiseMaskFrequency   = EditorGUILayout.Slider(GetLabel("Frequency"), noiseMaskFrequency, 0f, 1f);
                noiseMaskLacunarity  = EditorGUILayout.Slider(GetLabel("Lacunarity"), noiseMaskLacunarity, 1.5f, 3.5f);
                noiseZoom            = EditorGUILayout.Slider(GetLabel("Zoom"), noiseZoom, 1f, 1000f);
            }

            if (areaMaskMode != GaiaConstants.ImageFitnessFilterMode.None)
            {
                imageMaskSmoothIterations = EditorGUILayout.IntSlider(GetLabel("Smooth Mask"), m_stamper.m_imageMaskSmoothIterations, 0, 20);
                imageMaskNormalise        = EditorGUILayout.Toggle(GetLabel("Normalise Mask"), m_stamper.m_imageMaskNormalise);
                imageMaskInvert           = EditorGUILayout.Toggle(GetLabel("Invert Mask"), m_stamper.m_imageMaskInvert);
                imageMaskFlip             = EditorGUILayout.Toggle(GetLabel("Flip Mask"), m_stamper.m_imageMaskFlip);
            }
            GUILayout.EndVertical();

            GUILayout.BeginVertical("Helpers:", m_boxStyle);
            GUILayout.Space(20);
            //GUILayout.Label("Helpers:", EditorStyles.boldLabel);
            if (m_stamper.m_resources != null)
            {
                EditorGUILayout.LabelField("Sea Level", m_stamper.m_resources.m_seaLevel.ToString() + " m");
            }
            bool showSeaLevel = EditorGUILayout.Toggle(GetLabel("Show Sea Level"), m_stamper.m_showSeaLevel);
            //Color gizmoColour = EditorGUILayout.ColorField(GetLabel("Gizmo Colour"), m_stamper.m_gizmoColour);
            bool alwaysShow        = EditorGUILayout.Toggle(GetLabel("Always Show Stamper"), m_stamper.m_alwaysShow);
            bool showRulers        = m_stamper.m_showRulers = EditorGUILayout.Toggle(GetLabel("Show Rulers"), m_stamper.m_showRulers);
            bool showTerrainHelper = m_stamper.m_showTerrainHelper = EditorGUILayout.Toggle(GetLabel("Show Terrain Helper"), m_stamper.m_showTerrainHelper);

            GUILayout.EndVertical();

            //Check for changes, make undo record, make changes and let editor know we are dirty
            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(m_stamper, "Made changes");

                //Check to see if we need to load a new stamp
                if (feature != null)
                {
                    if (m_stamper.m_stampPreviewImage == null)
                    {
                        m_stamper.m_stampPreviewImage = feature;
                        m_stamper.LoadStamp();
                        m_stamper.FitToTerrain();
                        baseLevel = m_stamper.m_baseLevel;
                        width     = m_stamper.m_width;
                        height    = m_stamper.m_height;
                        rotation  = m_stamper.m_rotation;
                        x         = m_stamper.m_x;
                        y         = m_stamper.m_y;
                        z         = m_stamper.m_z;
                    }
                    else if (m_stamper.m_stampPreviewImage.GetInstanceID() != feature.GetInstanceID())
                    {
                        m_stamper.m_stampPreviewImage = feature;
                        m_stamper.LoadStamp();
                        baseLevel = m_stamper.m_baseLevel;
                    }
                }

                //And invert it
                if (m_stamper.m_invertStamp != invertStamp)
                {
                    m_stamper.m_invertStamp = invertStamp;
                    m_stamper.InvertStamp();
                }

                //And normalise it
                if (m_stamper.m_normaliseStamp != normaliseStamp)
                {
                    m_stamper.m_normaliseStamp = normaliseStamp;
                    if (normaliseStamp)
                    {
                        m_stamper.NormaliseStamp();
                    }
                    else
                    {
                        m_stamper.LoadStamp();
                        baseLevel = m_stamper.m_baseLevel;
                    }
                }

                m_stamper.m_heightModifier   = heightModifier;
                m_stamper.m_drawStampBase    = stampBase;
                m_stamper.m_stampOperation   = operation;
                m_stamper.m_blendStrength    = blendStrength;
                m_stamper.m_stencilHeight    = stencilHeight;
                m_stamper.m_distanceMask     = distanceMask;
                m_stamper.m_smoothIterations = smoothIterations;
                m_stamper.m_resources        = resources;
                m_stamper.m_x                         = x;
                m_stamper.m_y                         = y;
                m_stamper.m_z                         = z;
                m_stamper.m_width                     = width;
                m_stamper.m_height                    = height;
                m_stamper.m_rotation                  = rotation;
                m_stamper.m_stickBaseToGround         = stickBaseToGround;
                m_stamper.m_alwaysShow                = alwaysShow;
                m_stamper.m_showSeaLevel              = showSeaLevel;
                m_stamper.m_baseLevel                 = baseLevel;
                m_stamper.m_showBase                  = showBase;
                m_stamper.m_showRulers                = showRulers;
                m_stamper.m_showTerrainHelper         = showTerrainHelper;
                m_stamper.m_areaMaskMode              = areaMaskMode;
                m_stamper.m_imageMask                 = imageMask;
                m_stamper.m_imageMaskInvert           = imageMaskInvert;
                m_stamper.m_imageMaskNormalise        = imageMaskNormalise;
                m_stamper.m_imageMaskFlip             = imageMaskFlip;
                m_stamper.m_imageMaskSmoothIterations = imageMaskSmoothIterations;

                m_stamper.m_noiseMaskSeed        = noiseMaskSeed;
                m_stamper.m_noiseMaskOctaves     = noiseMaskOctaves;
                m_stamper.m_noiseMaskPersistence = noiseMaskPersistence;
                m_stamper.m_noiseMaskFrequency   = noiseMaskFrequency;
                m_stamper.m_noiseMaskLacunarity  = noiseMaskLacunarity;
                m_stamper.m_noiseZoom            = noiseZoom;

                //Update the stamp calcs
                m_stamper.UpdateStamp();

                EditorUtility.SetDirty(m_stamper);
            }

            //Terrain control
            if (showTerrainHelper)
            {
                GUILayout.BeginVertical("Terrain Helper", m_boxStyle);
                GUILayout.Space(20);

                if (GUILayout.Button(GetLabel("Show Terrain Utilities")))
                {
                    var export = EditorWindow.GetWindow <GaiaTerrainExplorerEditor>(false, "Terrain Utilities");
                    export.Show();
                }

                GUILayout.BeginHorizontal();
                if (GUILayout.Button(GetLabel("Flatten")))
                {
                    if (EditorUtility.DisplayDialog("Flatten Terrain tiles ?", "Are you sure you want to flatten all terrain tiles - this can not be undone ?", "Yes", "No"))
                    {
                        m_stamper.FlattenTerrain();
                    }
                }

                if (GUILayout.Button(GetLabel("Smooth")))
                {
                    if (EditorUtility.DisplayDialog("Smooth Terrain tiles ?", "Are you sure you want to smooth all terrain tiles - this can not be undone ?", "Yes", "No"))
                    {
                        m_stamper.SmoothTerrain();
                    }
                }
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();

                if (GUILayout.Button(GetLabel("Clear Trees")))
                {
                    if (EditorUtility.DisplayDialog("Clear Terrain trees ?", "Are you sure you want to clear all terrain trees - this can not be undone ?", "Yes", "No"))
                    {
                        m_stamper.ClearTrees();
                    }
                }
                if (GUILayout.Button(GetLabel("Clear Details")))
                {
                    if (EditorUtility.DisplayDialog("Clear Terrain details ?", "Are you sure you want to clear all terrain details - this can not be undone ?", "Yes", "No"))
                    {
                        m_stamper.ClearDetails();
                    }
                }

                GUILayout.EndHorizontal();
                GUILayout.Space(5);
                GUILayout.EndVertical();
            }


            //Regardless, re-enable the spawner controls
            GUI.enabled = true;

            //Display progress
            if (m_stamper.m_stampComplete != true && !m_stamper.m_cancelStamp)
            {
                GUILayout.BeginVertical("Stamp Controller", m_boxStyle);
                GUILayout.Space(20);
                GUILayout.BeginHorizontal();
                if (GUILayout.Button(GetLabel("Cancel")))
                {
                    m_stamper.CancelStamp();
                }
                GUILayout.EndHorizontal();
                GUILayout.Space(5);
                GUILayout.EndVertical();
                ProgressBar(string.Format("Progress ({0:0.0}%)", m_stamper.m_stampProgress * 100f), m_stamper.m_stampProgress);
            }
            else
            {
                //Stamp control
                GUILayout.BeginVertical("Stamp Controller", m_boxStyle);
                GUILayout.Space(20);
                if (!m_stamper.CanPreview())
                {
                    GUI.enabled = false;
                }

                GUILayout.BeginHorizontal();
                if (GUILayout.Button(GetLabel("Ground")))
                {
                    m_stamper.AlignToGround();
                    m_stamper.UpdateStamp();
                }
                if (GUILayout.Button(GetLabel("Fit To Terrain")))
                {
                    m_stamper.FitToTerrain();
                    m_stamper.UpdateStamp();
                }
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                if (GUILayout.Button(GetLabel("Preview")))
                {
                    m_stamper.TogglePreview();
                }
                GUI.enabled = true;
                if (m_stamper.m_stampPreviewImage == null)
                {
                    GUI.enabled = false;
                }
                if (GUILayout.Button(GetLabel("Stamp")))
                {
                    //Check that they have a single selected terrain
                    if (Gaia.TerrainHelper.GetActiveTerrainCount() != 1)
                    {
                        EditorUtility.DisplayDialog("OOPS!", "You must have only one active terrain in order to use a Spawner. Please either add a terrain, or deactivate all but one terrain.", "OK");
                    }
                    else
                    {
                        //Check that the centre of the terrain is at 0,0,0, and offer to move
                        bool    isCentred = true;
                        Bounds  b         = new Bounds();
                        Terrain terrain   = Gaia.TerrainHelper.GetActiveTerrain();
                        Gaia.TerrainHelper.GetTerrainBounds(terrain, ref b);
                        if ((b.center.x != 0f) || (b.min.y != 0f) || (b.center.z != 0f))
                        {
                            isCentred = false;
                            if (EditorUtility.DisplayDialog("OOPS!", "The terrain must be centered at 0,0,0 for stamping to work properly. Would you like GAIA to move it for you? You will need to reposition your stamp after this to adjust for the movement. You can move the terrain back to its original position after you have finished with the stamper.", "OK", "Cancel"))
                            {
                                terrain.transform.position = new Vector3(b.extents.x * -1f, 0f, b.extents.z * -1f);
                            }
                        }

                        if (isCentred)
                        {
                            //Check that they are not using terrain based mask - this can give unexpected results
                            if (areaMaskMode == GaiaConstants.ImageFitnessFilterMode.TerrainTexture0 ||
                                areaMaskMode == GaiaConstants.ImageFitnessFilterMode.TerrainTexture1 ||
                                areaMaskMode == GaiaConstants.ImageFitnessFilterMode.TerrainTexture2 ||
                                areaMaskMode == GaiaConstants.ImageFitnessFilterMode.TerrainTexture3 ||
                                areaMaskMode == GaiaConstants.ImageFitnessFilterMode.TerrainTexture4 ||
                                areaMaskMode == GaiaConstants.ImageFitnessFilterMode.TerrainTexture5 ||
                                areaMaskMode == GaiaConstants.ImageFitnessFilterMode.TerrainTexture6 ||
                                areaMaskMode == GaiaConstants.ImageFitnessFilterMode.TerrainTexture7
                                )
                            {
                                //Do an alert and fix if necessary
                                if (!m_stamper.IsFitToTerrain())
                                {
                                    if (EditorUtility.DisplayDialog("WARNING!", "This feature requires your stamp to be Fit To Terrain in order to guarantee correct placement.", "Stamp Anyway", "Cancel"))
                                    {
                                        m_stamper.Stamp();
                                    }
                                }
                                else
                                {
                                    m_stamper.Stamp();
                                }
                            }
                            else
                            {
                                m_stamper.Stamp();
                            }
                        }
                    }
                }
                GUI.enabled = true;

                if (m_stamper.CanRedo())
                {
                    if (GUILayout.Button(GetLabel("Redo")))
                    {
                        m_stamper.Redo();
                    }
                }
                else
                {
                    if (!m_stamper.CanUndo())
                    {
                        GUI.enabled = false;
                    }

                    if (GUILayout.Button(GetLabel("Undo")))
                    {
                        m_stamper.Undo();
                    }
                }

                GUI.enabled = true;

                GUILayout.EndHorizontal();
                GUILayout.Space(5);
                GUILayout.EndVertical();

                GUILayout.Space(5f);
            }
        }
예제 #25
0
        public override void OnInspectorGUI()
        {
            //Initialization
            m_editorUtils.Initialize(); // Do not remove this!

            //Monitor for changes
            EditorGUI.BeginChangeCheck();

            defaultBackground = GUI.backgroundColor;

            if (m_gaiaSettings == null)
            {
                m_gaiaSettings = GaiaUtils.GetGaiaSettings();
            }

            if (m_renderPipeline != m_gaiaSettings.m_pipelineProfile.m_activePipelineInstalled)
            {
                m_renderPipeline = m_gaiaSettings.m_pipelineProfile.m_activePipelineInstalled;
            }

            if (m_profile.m_selectedLightingProfileValuesIndex > m_profile.m_lightingProfiles.Count - 1)
            {
                m_profile.m_selectedLightingProfileValuesIndex = 0;
            }

            EditorGUILayout.LabelField("Profile Version: " + m_version);
            if (enableEditMode)
            {
                m_profile.m_editSettings = EditorGUILayout.ToggleLeft("Use Procedural Worlds Editor Settings", m_profile.m_editSettings);
            }
            else
            {
                m_profile.m_editSettings = false;
            }

            if (m_profile.m_editSettings)
            {
                m_editorUtils.Panel("UpdateSettings", RealtimeUpdateEnabled);
                m_editorUtils.Panel("GlobalSettings", GlobalSettingsEnabled);
                m_editorUtils.Panel("LightingProfileSettings", LightingProfileSettingsEnabled);

                DrawDefaultInspector();
            }

            //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);

                if (m_profile.m_updateInRealtime)
                {
                    if (m_profile.m_selectedLightingProfileValuesIndex != -99)
                    {
                        GaiaUtils.GetRuntimeSceneObject();

                        if (GaiaGlobal.Instance != null)
                        {
                            //GaiaLighting.GetProfile(m_profile, m_gaiaSettings.m_pipelineProfile, m_gaiaSettings.m_pipelineProfile.m_activePipelineInstalled);
                        }
                    }
                    EditorUtility.SetDirty(m_profile);
                }
            }
        }
예제 #26
0
        public override void OnInspectorGUI()
        {
            m_editorUtils.Initialize(); // Do not remove this!
            m_manager = (GaiaSessionManager)target;
            serializedObject.Update();

            SetupOperationHeaderColor(ref m_operationCreateWorldStyle, "3FC1C9ff", "297e83ff", m_tempTextureList);
            SetupOperationHeaderColor(ref m_operationFlattenTerrainStyle, "C46564ff", "804241ff", m_tempTextureList);
            SetupOperationHeaderColor(ref m_operationClearSpawnsStyle, "F0E999ff", "9d9864ff", m_tempTextureList);
            SetupOperationHeaderColor(ref m_operationStampStyle, "B8C99Dff", "788367ff", m_tempTextureList);
            SetupOperationHeaderColor(ref m_operationStampUndoRedoStyle, "d1a6a3ff", "896c6bff", m_tempTextureList);
            SetupOperationHeaderColor(ref m_operationSpawnStyle, "EEB15Bff", "9c743bff", m_tempTextureList);
            SetupOperationHeaderColor(ref m_operationRemoveNonBiomeResourcesStyle, "ba7fcdff", "7a5386ff", m_tempTextureList);
            SetupOperationHeaderColor(ref m_operationMaskMapExportStyle, "9e955bff", "635D39ff", m_tempTextureList);

            if (m_operationCheckboxStyle == null)
            {
                m_operationCheckboxStyle            = new GUIStyle(GUI.skin.toggle);
                m_operationCheckboxStyle.fixedWidth = 15;
                m_operationCheckboxStyle.margin     = new RectOffset(5, 0, 0, 0);
                m_operationCheckboxStyle.padding    = new RectOffset(0, 0, 0, 5);
            }

            if (m_operationFoldOutStyle == null)
            {
                m_operationFoldOutStyle        = new GUIStyle(EditorStyles.foldout);
                m_operationFoldOutStyle.margin = new RectOffset(0, 0, 0, 0);
            }

            //m_scrollPosition = GUILayout.BeginScrollView(m_scrollPosition, false, false);

            m_editorUtils.Panel("Summary", DrawSummary, true);

            m_editorUtils.Panel("Operations", DrawOperations, true);


            //End scroll
            //GUILayout.EndScrollView();

            #region OLD CODE

            ////Set up the box style
            //if (m_boxStyle == null)
            //{
            //    m_boxStyle = new GUIStyle(GUI.skin.box);
            //    m_boxStyle.normal.textColor = GUI.skin.label.normal.textColor;
            //    m_boxStyle.fontStyle = FontStyle.Bold;
            //    m_boxStyle.alignment = TextAnchor.UpperLeft;
            //}

            ////Setup the wrap style
            //if (m_wrapStyle == null)
            //{
            //    m_wrapStyle = new GUIStyle(GUI.skin.label);
            //    m_wrapStyle.wordWrap = true;
            //}

            ////Set up the description wrap style
            //if (m_descWrapStyle == null)
            //{
            //    m_descWrapStyle = new GUIStyle(GUI.skin.textArea);
            //    m_descWrapStyle.wordWrap = true;
            //}

            ////Scroll

            ////Create a nice text intro
            //GUILayout.BeginVertical("Gaia Session Manager", m_boxStyle);
            //GUILayout.Space(20);
            //EditorGUILayout.LabelField("Track and control session creation and playback.", m_wrapStyle);
            //GUILayout.Space(4);
            //EditorGUILayout.BeginHorizontal();
            //m_manager.m_session = (GaiaSession)EditorGUILayout.ObjectField(GetLabel("Session"), m_manager.m_session, typeof(GaiaSession), false);

            //if (GUILayout.Button(GetLabel("New"), GUILayout.Width(45)))
            //{
            //    m_manager.CreateSession();
            //}
            //EditorGUILayout.EndHorizontal();
            //GUILayout.EndVertical();

            //if (m_manager.m_session == null)
            //{
            //    GUILayout.EndScrollView();
            //    return;
            //}

            ////Track changes
            ////EditorGUI.BeginChangeCheck();

            ////Make some space
            //GUILayout.Space(4);

            ////Wrap it up in a box

            ////Display the basic details
            //EditorGUILayout.LabelField("Name");
            //if (m_manager.IsLocked())
            //{
            //    GUI.enabled = false;
            //}
            //string name = EditorGUILayout.TextArea(m_manager.m_session.m_name, m_descWrapStyle, GUILayout.MinHeight(15));
            //GUI.enabled = true;

            //EditorGUILayout.LabelField("Description");
            //if (m_manager.IsLocked())
            //{
            //    GUI.enabled = false;
            //}
            //string description = EditorGUILayout.TextArea(m_manager.m_session.m_description, m_descWrapStyle, GUILayout.MinHeight(45));

            //Texture2D previewImage = m_manager.GetPreviewImage();
            //if (!m_manager.IsLocked())
            //{
            //    previewImage = (Texture2D)EditorGUILayout.ObjectField(GetLabel("Preview Image"), m_manager.m_session.m_previewImage, typeof(Texture2D), false, GUILayout.MaxHeight(15f));
            //}

            ////Detect change in session and handle changes to preview image
            //float width, height;
            //if (m_manager.m_session.GetInstanceID() != m_lastSessionID)
            //{
            //    m_lastPreviewImgName = "";
            //    m_lastSessionID = m_manager.m_session.GetInstanceID();
            //    if (m_manager.HasPreviewImage())
            //    {
            //        previewImage = m_manager.GetPreviewImage();
            //        m_lastPreviewImgName = previewImage.name;
            //    }
            //}
            //else //Process changes to preview image
            //{
            //    if (previewImage == null)
            //    {
            //        if (m_manager.IsLocked()) //Undo change if locked
            //        {
            //            if (m_manager.HasPreviewImage())
            //            {
            //                previewImage = m_manager.GetPreviewImage();
            //                m_lastPreviewImgName = previewImage.name;
            //                Debug.LogWarning("You can not change the image on a locked session");
            //            }
            //        }
            //        else
            //        {
            //            if (m_manager.HasPreviewImage())
            //            {
            //                m_manager.RemovePreviewImage();
            //                m_lastPreviewImgName = "";
            //            }
            //        }
            //    }
            //    else
            //    {
            //        //Handle changes to preview image
            //        if (previewImage.name != m_lastPreviewImgName)
            //        {
            //            if (m_manager.IsLocked()) //Revert
            //            {
            //                if (m_manager.HasPreviewImage())
            //                {
            //                    previewImage = m_manager.GetPreviewImage();
            //                    m_lastPreviewImgName = previewImage.name;
            //                    Debug.LogWarning("You can not change the image on a locked session");
            //                }
            //                else
            //                {
            //                    previewImage = null;
            //                    m_lastPreviewImgName = "";
            //                }
            //            }
            //            else
            //            {
            //                //Make it readable
            //                Gaia.GaiaUtils.MakeTextureReadable(previewImage);

            //                //Make a new texture from it
            //                Texture2D newTexture = new Texture2D(previewImage.width, previewImage.height, TextureFormat.ARGB32, false);
            //                newTexture.name = m_manager.m_session.m_name;
            //                newTexture.SetPixels(previewImage.GetPixels(0));
            //                newTexture.Apply();

            //                //Resize and scale it
            //                width = 320;
            //                height = previewImage.height * (width / previewImage.width);
            //                Gaia.ScaleTexture.Bilinear(newTexture, (int)width, (int)height);

            //                //Compress it
            //                //newTexture.Compress(true);

            //                //And store its content
            //                m_manager.AddPreviewImage(newTexture);

            //                //Assign back to the texture for the scene
            //                previewImage = newTexture;
            //                m_lastPreviewImgName = previewImage.name;
            //            }
            //        }
            //    }
            //}

            //GUI.enabled = true; //In response to locked above

            //if (previewImage != null)
            //{
            //    //Get aspect ratio and available space and display the image
            //    width = Screen.width - 43f;
            //    height = previewImage.height * (width / previewImage.width);
            //    GUILayout.Label(previewImage, GUILayout.MaxWidth(width), GUILayout.MaxHeight(height));
            //}

            //EditorGUILayout.LabelField("Created", m_manager.m_session.m_dateCreated);
            //EditorGUILayout.LabelField("Dimensions", string.Format("w{0} d{1} h{2}", m_manager.m_session.m_terrainWidth, m_manager.m_session.m_terrainDepth, m_manager.m_session.m_terrainHeight));

            //if (m_manager.IsLocked())
            //{
            //    GUI.enabled = false;
            //}
            //m_manager.m_session.m_seaLevel = EditorGUILayout.Slider(GetLabel("Sea Level"), m_manager.m_session.m_seaLevel, 0f, m_manager.m_session.m_terrainDepth);
            //GUI.enabled = true; //In response to locked above

            //bool locked = EditorGUILayout.Toggle(GetLabel("Locked"), m_manager.m_session.m_isLocked);
            //GUILayout.EndVertical();

            ////Iterate through the operations
            //GUILayout.BeginVertical("Operations:", m_boxStyle);
            //GUILayout.Space(20);

            //if (m_manager.m_session.m_operations.Count == 0)
            //{
            //    GUILayout.Space(5);
            //    GUILayout.Label("No operations yet...");
            //    GUILayout.Space(5);
            //}
            //else
            //{
            //    GaiaOperation op;
            //    EditorGUI.indentLevel++;
            //    for (int opIdx = 0; opIdx < m_manager.m_session.m_operations.Count; opIdx++)
            //    {
            //        op = m_manager.m_session.m_operations[opIdx];

            //        if (op.m_isActive)
            //        {
            //            op.m_isFoldedOut = EditorGUILayout.Foldout(op.m_isFoldedOut, op.m_description, true);
            //        }
            //        else
            //        {
            //            op.m_isFoldedOut = EditorGUILayout.Foldout(op.m_isFoldedOut, op.m_description + " [inactive]", true);
            //        }

            //        if (op.m_isFoldedOut)
            //        {
            //            EditorGUI.indentLevel++;

            //            EditorGUILayout.LabelField("Description", op.m_description, m_wrapStyle);
            //            EditorGUILayout.LabelField("Created", op.m_operationDateTime);
            //            if (m_manager.m_session.m_isLocked)
            //            {
            //                GUI.enabled = false;
            //            }
            //            op.m_isActive = EditorGUILayout.Toggle(GetLabel("Active"), op.m_isActive);
            //            GUI.enabled = true;

            //            int dataLength = 0;
            //            for (int idx = 0; idx < op.m_operationDataJson.GetLength(0); idx++)
            //            {
            //                dataLength += op.m_operationDataJson[idx].Length;
            //            }
            //            EditorGUILayout.LabelField("Data", dataLength.ToString() + " bytes");

            //            GUILayout.BeginHorizontal();
            //            GUILayout.FlexibleSpace();
            //            if (m_manager.m_session.m_isLocked)
            //            {
            //                GUI.enabled = false;
            //            }
            //            if (GUILayout.Button(GetLabel("Delete")))
            //            {
            //                if (EditorUtility.DisplayDialog("Delete Operation ?", "Are you sure you want to delete this operation ?", "Yes", "No"))
            //                {
            //                    m_manager.RemoveOperation(opIdx);
            //                }
            //            }
            //            GUI.enabled = true;
            //            if (GUILayout.Button(GetLabel("Apply")))
            //            {
            //                //m_manager.Apply(opIdx);
            //            }
            //            if (GUILayout.Button(GetLabel("Play")))
            //            {
            //                m_manager.PlayOperation(opIdx);
            //            }
            //            GUILayout.EndHorizontal();

            //            EditorGUI.indentLevel--;
            //        }
            //        //EditorGUILayout.Space();
            //    }
            //    EditorGUI.indentLevel--;
            //}
            //GUILayout.EndVertical();

            ////Create a nice text intro
            //if (!m_manager.m_session.m_isLocked)
            //{
            //    GUILayout.BeginVertical(m_boxStyle);
            //    m_manager.m_genShowRandomGenerator = EditorGUILayout.BeginToggleGroup(GetLabel(" Random Terrain Generator"), m_manager.m_genShowRandomGenerator);
            //    if (m_manager.m_genShowRandomGenerator)
            //    {
            //        m_manager.m_useRandomSeed = EditorGUILayout.Toggle("Use Random Seed", m_manager.m_useRandomSeed);
            //        if (!m_manager.m_useRandomSeed)
            //        {
            //            m_manager.m_randomSeed = EditorGUILayout.IntField(GetLabel("Random Seed"), m_manager.m_randomSeed);
            //        }
            //        m_manager.m_genGridSize = EditorGUILayout.IntSlider(GetLabel("Stamp Grid"), m_manager.m_genGridSize, 1, 5);
            //        if (m_manager.m_genGridSize == 1)
            //        {
            //            m_manager.m_genNumStampsToGenerate = 1;
            //        }
            //        else
            //        {
            //            m_manager.m_genNumStampsToGenerate = (m_manager.m_genGridSize * m_manager.m_genGridSize) + 1;
            //        }
            //        EditorGUILayout.LabelField(new GUIContent("Stamps Generated"), new GUIContent(m_manager.m_genNumStampsToGenerate.ToString()));
            //        //m_manager.m_genNumStampsToGenerate = EditorGUILayout.IntSlider(GetLabel("Stamps"), m_manager.m_genNumStampsToGenerate, 1, 26);
            //        m_manager.m_genScaleWidth = EditorGUILayout.Slider(GetLabel("Width Scale"), m_manager.m_genScaleWidth, 0.5f, 100f);
            //        m_manager.m_genScaleHeight = EditorGUILayout.Slider(GetLabel("Height Scale"), m_manager.m_genScaleHeight, 0.5f, 100f);
            //        m_manager.m_genBorderStyle = (Gaia.GaiaConstants.GeneratorBorderStyle)EditorGUILayout.EnumPopup(GetLabel("Border Style"), m_manager.m_genBorderStyle);
            //        m_manager.m_genChanceOfHills = EditorGUILayout.Slider(GetLabel("Hill Chance"), m_manager.m_genChanceOfHills, 0f, 1f);
            //        m_manager.m_genChanceOfIslands = EditorGUILayout.Slider(GetLabel("Island Chance"), m_manager.m_genChanceOfIslands, 0f, 1f);
            //        m_manager.m_genChanceOfLakes = EditorGUILayout.Slider(GetLabel("Lake Chance"), m_manager.m_genChanceOfLakes, 0f, 1f);
            //        m_manager.m_genChanceOfMesas = EditorGUILayout.Slider(GetLabel("Mesa Chance"), m_manager.m_genChanceOfMesas, 0f, 1f);
            //        m_manager.m_genChanceOfMountains = EditorGUILayout.Slider(GetLabel("Mountain Chance"), m_manager.m_genChanceOfMountains, 0f, 1f);
            //        m_manager.m_genChanceOfPlains = EditorGUILayout.Slider(GetLabel("Plains Chance"), m_manager.m_genChanceOfPlains, 0f, 1f);
            //        m_manager.m_genChanceOfRivers = EditorGUILayout.Slider(GetLabel("River Chance"), m_manager.m_genChanceOfRivers, 0f, 1f);
            //        m_manager.m_genChanceOfValleys = EditorGUILayout.Slider(GetLabel("Valley Chance"), m_manager.m_genChanceOfValleys, 0f, 1f);
            //        m_manager.m_genChanceOfVillages = EditorGUILayout.Slider(GetLabel("Village Chance"), m_manager.m_genChanceOfVillages, 0f, 1f);
            //        m_manager.m_genChanceOfWaterfalls = EditorGUILayout.Slider(GetLabel("Waterfall Chance"), m_manager.m_genChanceOfWaterfalls, 0f, 1f);

            //        GUILayout.BeginHorizontal();
            //        if (GUILayout.Button(GetLabel("Reset Session")))
            //        {
            //            if (EditorUtility.DisplayDialog("Reset Session ?", "Are you sure you want to reset your session - this can not be undone ?", "Yes", "No"))
            //            {
            //                m_manager.ResetSession();
            //            }
            //        }
            //        if (GUILayout.Button(GetLabel("Add Stamps")))
            //        {
            //            m_manager.RandomiseStamps();
            //        }
            //        GUILayout.EndHorizontal();
            //    }
            //    EditorGUILayout.EndToggleGroup();
            //    GUILayout.EndVertical();
            //}

            ////Create a nice text intro
            //GUILayout.BeginVertical(m_boxStyle);
            //m_manager.m_genShowTerrainHelper = EditorGUILayout.BeginToggleGroup(GetLabel(" Terrain Helper"), m_manager.m_genShowTerrainHelper);
            //if (m_manager.m_genShowTerrainHelper)
            //{
            //    GUILayout.BeginHorizontal();
            //    if (GUILayout.Button(GetLabel("Flatten Terrain")))
            //    {
            //        if (EditorUtility.DisplayDialog("Flatten Terrain?", "Are you sure you want to flatten your terrain - this can not be undone ?", "Yes", "No"))
            //        {
            //            GaiaWorldManager wm = new GaiaWorldManager(Terrain.activeTerrains);
            //            wm.FlattenWorld();
            //        }
            //    }
            //    if (GUILayout.Button(GetLabel("Smooth Terrain")))
            //    {
            //        if (EditorUtility.DisplayDialog("Smooth Terrain?", "Are you sure you want to smooth your terrain - this can not be undone ?", "Yes", "No"))
            //        {
            //            GaiaWorldManager wm = new GaiaWorldManager(Terrain.activeTerrains);
            //            wm.SmoothWorld();
            //        }
            //    }
            //    GUILayout.EndHorizontal();

            //    GUILayout.BeginHorizontal();
            //    if (GUILayout.Button(GetLabel("Clear Trees")))
            //    {
            //        if (EditorUtility.DisplayDialog("Clear Trees?", "Are you sure you want to clear your trees - this can not be undone ?", "Yes", "No"))
            //        {
            //            TerrainHelper.ClearTrees(ClearSpawnFor.AllTerrains,ClearSpawnFrom.AnySource);
            //        }
            //    }
            //    if (GUILayout.Button(GetLabel("Clear Details")))
            //    {
            //        if (EditorUtility.DisplayDialog("Clear Details?", "Are you sure you want to clear your details / grass - this can not be undone ?", "Yes", "No"))
            //        {
            //            TerrainHelper.ClearDetails(ClearSpawnFor.AllTerrains,ClearSpawnFrom.AnySource);
            //        }
            //    }
            //    GUILayout.EndHorizontal();
            //}
            //EditorGUILayout.EndToggleGroup();
            //GUILayout.EndVertical();



            //GUILayout.BeginVertical("Session Controller", m_boxStyle);
            //GUILayout.Space(20);
            //GUILayout.BeginHorizontal();
            //bool focusSceneView = EditorGUILayout.Toggle(GetLabel("Focus Scene View"), m_manager.m_focusSceneView);
            //GUILayout.EndHorizontal();
            //GUILayout.Space(5);
            //GUILayout.BeginHorizontal();
            //if (m_manager.m_updateSessionCoroutine == null && m_manager.m_updateOperationCoroutine == null)
            //{



            //    if (GUILayout.Button(GetLabel("Play Session")))
            //    {
            //        if (EditorUtility.DisplayDialog("Playback Session ?", "Are you sure you want to playback your session - this can not be undone ?", "Yes", "No"))
            //        {
            //            m_manager.PlaySession();
            //        }
            //    }
            //    if (GUILayout.Button(GetLabel("Export Resources")))
            //    {
            //        //m_manager.ExportSessionResources();
            //    }
            //}
            //else
            //{
            //    if (GUILayout.Button(GetLabel("Cancel")))
            //    {
            //        m_manager.CancelPlayback();
            //    }
            //}

            //GUILayout.EndHorizontal();
            //GUILayout.Space(5);


            ////Check for changes, make undo record, make changes and let editor know we are dirty
            //if (EditorGUI.EndChangeCheck())
            //{
            //    Undo.RecordObject(m_manager, "Made changes");
            //    m_manager.m_session.m_name = name;
            //    m_manager.m_session.m_description = description;
            //    m_manager.m_session.m_isLocked = locked;
            //    m_manager.m_session.m_previewImage = previewImage;
            //    m_manager.m_focusSceneView = focusSceneView;
            //    EditorUtility.SetDirty(m_manager.m_session);
            //    EditorUtility.SetDirty(m_manager);
            //}

            ////Debug.Log(m_manager.m_lastUpdateDateTime);

            ////Draw the various spawner progress bars
            //if (m_manager.m_currentStamper != null)
            //{
            //    if (m_manager.m_currentStamper.IsStamping())
            //    {
            //        ProgressBar(string.Format("{0}:{1} ({2:0.0}%)", m_manager.m_currentStamper.gameObject.name, m_manager.m_currentStamper.m_stampImage.name, m_manager.m_currentStamper.m_stampProgress * 100f), m_manager.m_currentStamper.m_stampProgress);
            //    }
            //}
            //if (m_manager.m_currentSpawner != null)
            //{
            //    if (m_manager.m_currentSpawner.IsSpawning())
            //    {
            //        ProgressBar(string.Format("{0} ({1:0.0}%)", m_manager.m_currentSpawner.gameObject.name, m_manager.m_currentSpawner.m_spawnProgress * 100f), m_manager.m_currentSpawner.m_spawnProgress);
            //    }
            //}

            //GUILayout.EndVertical();


            //GUILayout.EndVertical();

            #endregion
        }