Separator() public static method

public static Separator ( ) : void
return void
    void ShowHeightmaps()
    {
        LandmassEditorUtilities editorUtilities = LandmassEditorUtilities.Instance;
        ImporterConfiguration   importCfg       = editorUtilities.ImportCfg;

        EGL.BeginVertical();
        {
            GUILayout.Label("The settings for processing heightmaps.");

            EGL.Separator();

            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                GUILayout.Label("Postfix for heightmap files.");
                importCfg.HeightmapTag = EGL.TextField("Name postfix", importCfg.HeightmapTag);
            }
            EGL.EndVertical();

            EGL.Separator();

            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                GUILayout.Label("Heightmap file specifications. Please use raw file\nwith x^2+1 dimensions.");
                importCfg.HeightmapExtention = EGL.TextField("File extention", importCfg.HeightmapExtention);
                importCfg.HeightmapFlipX     = EGL.Toggle("Mirror X", importCfg.HeightmapFlipX);
                importCfg.HeightmapFlipY     = EGL.Toggle("Mirror Y", importCfg.HeightmapFlipY);
                importCfg.HeightFormat       = (HeightfileFormat)EditorGUILayout.EnumPopup("Byte Format", importCfg.HeightFormat);
            }
            EGL.EndVertical();
        }
        EGL.EndVertical();
    }
    void ShowSettings()
    {
        LandmassEditorUtilities editorUtilities = LandmassEditorUtilities.Instance;
        ImporterConfiguration   importCfg       = editorUtilities.ImportCfg;

        EGL.BeginVertical();
        {
            EGL.Separator();

            GUILayout.Label("LOD Levels");

            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                if (importCfg.LodLevels.Count >= 4)
                {
                    GUI.enabled = false;
                }
                if (GUILayout.Button("Add LOD Level"))
                {
                    importCfg.LodLevels.Add(new LodLevel());
                    importCfg.IsDirty = true; // Todo: Nasty
                }
                GUI.enabled = true;

                // Show the list of LODS
                EGL.BeginVertical();
                {
                    _lodScrollPos = EGL.BeginScrollView(_lodScrollPos, GUILayout.MinHeight(96f), GUILayout.MaxHeight(Screen.height));
                    {
                        var removeThese = new List <LodLevel>();
                        int i           = 0;
                        foreach (LodLevel lod in importCfg.LodLevels)
                        {
                            if (ShowLodLevel(lod, i))
                            {
                                removeThese.Add(lod);
                                importCfg.IsDirty = true; // Nasty
                            }
                            i++;
                        }
                        foreach (LodLevel lod in removeThese)
                        {
                            importCfg.LodLevels.Remove(lod);
                        }
                    }
                    EGL.EndScrollView();
                }
                EGL.EndVertical();

                EGL.Space();

                GUILayout.Label("Control how many assets are processed in one go.");
                importCfg.BatchLimit = EGL.IntField("Batch limit", importCfg.BatchLimit);
                GUILayout.Label("Larger batches mean faster processing but require\nmore memory. Change this with care, or Unity's\nmemory might run out!");
            }
            EGL.EndVertical();
        }
        EGL.EndVertical();
    }
    void OnGUI()
    {
        LandmassEditorUtilities editorUtilities = LandmassEditorUtilities.Instance;

        if (editorUtilities == null)
        {
            GUILayout.Label("No running instance of LandmassImporter found");
            return;
        }

        if (editorUtilities.IsProcessing)
        {
            ShowProgressBar();
        }

        GUI.enabled = !editorUtilities.IsProcessing;

        EGL.BeginVertical();
        {
            EGL.Separator();

            _currentState = (MenuState)GUILayout.Toolbar((int)_currentState, menuTitles);

            EGL.BeginHorizontal();
            {
                _globalScrollPos = EGL.BeginScrollView(_globalScrollPos, GuiUtils.Skin.box);
                {
                    EGL.BeginVertical();
                    {
                        EGL.Separator();

                        _menus[_currentState]();
                        GUILayout.FlexibleSpace();

                        EGL.Separator();
                    }
                    EGL.EndVertical();
                }
                EGL.EndScrollView();
            }
            EGL.EndHorizontal();

            EGL.Separator();

            ShowSaveButtons();

            GUILayout.Space(16);
        }
        EGL.EndVertical();

        GUI.enabled = true;
    }
 void ShowHelp()
 {
     EGL.BeginVertical();
     {
         GUILayout.Label("Landmass version: " + version); // Todo: Version number from xml?
         EGL.Separator();
         GUILayout.Label("Made by Martijn Zandvliet");
         EGL.Separator();
         if (GUILayout.Button("Show Documentation"))
         {
             Application.OpenURL(readmeUrl);
         }
     }
     EGL.EndVertical();
 }
    void ShowTerrainSettings()
    {
        LandmassEditorUtilities editorUtilities = LandmassEditorUtilities.Instance;
        ImporterConfiguration   importCfg       = editorUtilities.ImportCfg;
        TerrainConfiguration    terrainStreamingConfiguration = importCfg.TerrainConfiguration;

        EGL.BeginVertical();
        {
            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                if (GUILayout.Button("Apply to selected TerrainData assets"))
                {
                    QueueCall(editorUtilities.ApplyDimensionsToSelection);
                }
            }
            EGL.EndVertical();

            EGL.Separator();

            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                GUILayout.Label("In-game terrain LOD settings.");
                terrainStreamingConfiguration.HeightmapPixelError = EGL.Slider("Pixel Error", terrainStreamingConfiguration.HeightmapPixelError, 1f, 200f);
                terrainStreamingConfiguration.BasemapDistance     = EGL.FloatField("Basemap Dist.", terrainStreamingConfiguration.BasemapDistance);
                terrainStreamingConfiguration.CastShadows         = EGL.Toggle("Cast Shadows", terrainStreamingConfiguration.CastShadows);
                EGL.Separator();
                terrainStreamingConfiguration.DetailObjectDistance    = EGL.Slider("Detail Distance", terrainStreamingConfiguration.DetailObjectDistance, 0f, 250f);
                terrainStreamingConfiguration.DetailObjectDensity     = EGL.Slider("Detail Density", terrainStreamingConfiguration.DetailObjectDensity, 0f, 1f);
                terrainStreamingConfiguration.TreeDistance            = EGL.Slider("Tree Distance", terrainStreamingConfiguration.TreeDistance, 0f, 2000f);
                terrainStreamingConfiguration.TreeBillboardDistance   = EGL.Slider("Billboard Start", terrainStreamingConfiguration.TreeBillboardDistance, 50f, 2000f);
                terrainStreamingConfiguration.TreeCrossFadeLength     = EGL.Slider("Fade Length", terrainStreamingConfiguration.TreeCrossFadeLength, 0f, 200f);
                terrainStreamingConfiguration.TreeMaximumFullLODCount = EGL.IntSlider("Max Mesh Trees", terrainStreamingConfiguration.TreeMaximumFullLODCount, 0, 500);
                EGL.Separator();

                if (GUILayout.Button("Apply to selected Scene assets"))
                {
                    QueueCall(editorUtilities.ApplyTerrainLODSettingsToSelection);
                }
            }
            EGL.EndVertical();
        }
        EGL.EndVertical();
    }
    void ShowTiledImport()
    {
        EGL.BeginVertical();
        {
            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                GUILayout.Label("Terrain input folder");
                _tiledInputLodLevel = EGL.IntField("Lod Level", _tiledInputLodLevel);

                if (GUILayout.Button("Load into scene"))
                {
                    _doTiledImport = true;
                }

                EGL.Separator();
            }
            EGL.EndVertical();
        }
        EGL.EndVertical();
    }
    void ShowSaveButtons()
    {
        LandmassEditorUtilities editorUtilities = LandmassEditorUtilities.Instance;
        ImporterConfiguration   importCfg       = editorUtilities.ImportCfg;

        EGL.BeginVertical();
        {
            EGL.BeginHorizontal();
            {
                EGL.Separator();

                if (GUILayout.Button("Save Settings"))
                {
                    editorUtilities.SaveSettings();
                }
                if (GUILayout.Button("Load Settings"))
                {
                    editorUtilities.LoadSettings();
                }
                GUI.enabled = true;

                EGL.Separator();
            }
            EGL.EndHorizontal();

            EGL.BeginHorizontal();
            {
                GUILayout.FlexibleSpace();
                if (importCfg.IsDirty)
                {
                    GUILayout.Label("You have unsaved settings.");
                }
                GUILayout.FlexibleSpace();
            }
            EGL.EndHorizontal();
        }
        EGL.EndVertical();
    }
    void ShowSingleImport()
    {
        ImporterConfiguration config = LandmassEditorUtilities.Instance.ImportCfg;

        EGL.BeginVertical();
        {
            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                GUILayout.Label("Target Terrain");
                _singleTargetTerrain = EGL.ObjectField(_singleTargetTerrain, typeof(Terrain), true, GUILayout.Width(240f)) as Terrain;
            }
            EGL.EndVertical();

            EGL.Separator();

            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                /* ----- Heightmap ----- */

                GUILayout.Label("Heightmap");

                GUILayout.BeginHorizontal();
                {
                    EGL.LabelField("Path", _singleHeightmapPath);
                    if (GUILayout.Button("Browse", GUILayout.Width(60f)))
                    {
                        _singleHeightmapPath = EditorUtility.OpenFilePanel("Browse to Heightmap file",
                                                                           _singleHeightmapPath, "r16");
                    }
                }
                GUILayout.EndHorizontal();

                GUI.enabled = _singleHeightmapPath != "";
                {
                    if (GUILayout.Button("Apply"))
                    {
                        LandmasImporter.ParseHeightmapFileToTerrain(
                            _singleHeightmapPath,
                            _singleTargetTerrain.terrainData,
                            config.HeightFormat,
                            config.HeightmapFlipX,
                            config.HeightmapFlipY
                            );
                    }
                }
                GUI.enabled = true;
            }
            EGL.EndVertical();

            EGL.Separator();

            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                /* ----- Splatmaps ------ */

                GUILayout.Label("Splatmap");
                _singleSplatmap = EGL.ObjectField(_singleSplatmap, typeof(Texture2D), false, GUILayout.Width(100f), GUILayout.Height(100f)) as Texture2D;

                EGL.Separator();

                GUI.enabled = _singleSplatmap != null && _singleTargetTerrain != null;
                {
                    if (GUILayout.Button("Apply"))
                    {
                        var splatmap = new float[_singleSplatmap.width, _singleSplatmap.height, 4];
                        LandmasImporter.TextureToSplatMap(
                            _singleSplatmap,
                            ref splatmap,
                            false,
                            true);

                        LandmasImporter.Instance.NormalizeSplatmap(ref splatmap, config.NormalizationMode);
                        LandmasImporter.Instance.ParseSplatmapToTerrain(splatmap, _singleTargetTerrain.terrainData);
                    }
                }
                GUI.enabled = true;
            }
            EGL.EndVertical();

            EGL.Separator();

            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                /* ------ Treemaps ----- */

                GUILayout.Label("Treemap");
                _singleTreemap = EGL.ObjectField(_singleTreemap, typeof(Texture2D), false, GUILayout.Width(100f), GUILayout.Height(100f)) as Texture2D;

                GUI.enabled = _singleTreemap != null;
                {
                    if (GUILayout.Button("Apply"))
                    {
                        LandmasImporter.ParseTreemapTexturesToTerrain(_singleTreemap, _singleTargetTerrain.terrainData);
                    }
                }
                GUI.enabled = true;

                EGL.Separator();

                if (GUILayout.Button("Flush Terrain"))
                {
                    Terrain terrain = Selection.activeGameObject.GetComponent <Terrain>();
                    if (terrain)
                    {
                        Debug.Log("Flushing Terrain");
                        terrain.Flush();
                    }
                }
            }
            EGL.EndVertical();
        }
        EGL.EndVertical();
    }
    void ShowDetailMaps()
    {
        LandmassEditorUtilities editorUtilities = LandmassEditorUtilities.Instance;
        ImporterConfiguration   importCfg       = editorUtilities.ImportCfg;

        EGL.BeginVertical();
        {
            GUILayout.Label("The settings for processing detail maps.");

            EGL.Separator();

            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                GUILayout.Label("Postfix for detailmap files.");
                importCfg.SplatmapTag = EGL.TextField("Name postfix", importCfg.SplatmapTag);
            }
            EGL.EndVertical();

            EGL.Separator();

            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                GUILayout.Label("Splatmap file specifications. Please use x^2.");
                importCfg.SplatmapExtention = EGL.TextField("File extention", importCfg.SplatmapExtention);
                importCfg.SplatmapFlipX     = EGL.Toggle("Mirror X", importCfg.SplatmapFlipX);
                importCfg.SplatmapFlipY     = EGL.Toggle("Mirror Y", importCfg.SplatmapFlipY);
            }
            EGL.EndVertical();

            EGL.Separator();

            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                GUILayout.Label("The textures to assign. (Current count: " + editorUtilities.DetailPrototypes.Count + ")");

                EGL.Separator();

                EGL.BeginHorizontal();
                {
                    if (editorUtilities.DetailPrototypes.Count >= 8)
                    {
                        GUI.enabled = false;
                    }
                    if (GUILayout.Button("Add Prototype"))
                    {
                        editorUtilities.DetailPrototypes.Add(new DetailPrototype());
                        importCfg.IsDirty = true; // Todo: Nasty, because the above prototypes still need to be converted to a serializable format, which is not directly done here
                    }
                    GUI.enabled = true;
                }
                EGL.EndHorizontal();

                // Show the list
                EGL.BeginVertical();
                {
                    _prototypeScrollPos = EGL.BeginScrollView(_prototypeScrollPos, GUILayout.MinHeight(96f), GUILayout.MaxHeight(Screen.height));
                    {
                        List <DetailPrototype> removeThese = new List <DetailPrototype>();
                        int i = 0;
                        foreach (DetailPrototype prototype in editorUtilities.DetailPrototypes)
                        {
                            if (ShowDetailPrototype(prototype, i))
                            {
                                removeThese.Add(prototype);
                                importCfg.IsDirty = true; // Nasty
                            }
                            i++;
                        }
                        foreach (DetailPrototype prototype in removeThese)
                        {
                            editorUtilities.DetailPrototypes.Remove(prototype);
                        }
                    }
                    EGL.EndScrollView();
                }
                EGL.EndVertical();
            }
            EGL.EndVertical();
        }
        EGL.EndVertical();
    }
    void ShowTreemaps()
    {
        LandmassEditorUtilities editorUtilities = LandmassEditorUtilities.Instance;
        ImporterConfiguration   importCfg       = editorUtilities.ImportCfg;

        EGL.BeginVertical();
        {
            GUILayout.Label("The settings for processing tree maps.");

            EGL.Separator();

            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                GUILayout.Label("Postfix for treemap files.");
                importCfg.TreemapTag = EGL.TextField("Name postfix", importCfg.TreemapTag);
            }
            EGL.EndVertical();

            EGL.Separator();

            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                GUILayout.Label("Treemap file specifications. Please use x^2.");
                importCfg.SplatmapExtention = EGL.TextField("File extention", importCfg.SplatmapExtention);
            }
            EGL.EndVertical();

            EGL.Separator();

            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                GUILayout.Label("The prototypes to assign. (Current count: " + editorUtilities.TreePrototypes.Count + ")");

                EGL.Separator();

                EGL.BeginHorizontal();
                {
                    if (editorUtilities.TreePrototypes.Count >= 8)
                    {
                        GUI.enabled = false;
                    }
                    if (GUILayout.Button("Add Prototype"))
                    {
                        editorUtilities.TreePrototypes.Add(new TreePrototype());
                        importCfg.IsDirty = true; // Todo: Nasty
                    }
                    GUI.enabled = true;
                }
                EGL.EndHorizontal();

                // Show the list
                EGL.BeginVertical();
                {
                    _prototypeScrollPos = EGL.BeginScrollView(_prototypeScrollPos, GUILayout.MinHeight(96f), GUILayout.MaxHeight(Screen.height));
                    {
                        List <TreePrototype> removeThese = new List <TreePrototype>();
                        int i = 0;
                        foreach (TreePrototype prototype in editorUtilities.TreePrototypes)
                        {
                            if (ShowTreePrototype(prototype, i))
                            {
                                removeThese.Add(prototype);
                                importCfg.IsDirty = true; // Nasty
                            }
                            i++;
                        }
                        foreach (TreePrototype prototype in removeThese)
                        {
                            editorUtilities.TreePrototypes.Remove(prototype);
                        }
                    }
                    EGL.EndScrollView();
                }
                EGL.EndVertical();
            }
            EGL.EndVertical();
        }
        EGL.EndVertical();
    }
        public override void OnInspectorGUI()
        {
            //RG_NetworkLobbyManager rg_NetworkLobbyManager = (RG_NetworkLobbyManager)target;

            EditorGUILayout.BeginVertical("Box");

            if (m_DontDestroyOnLoadProperty == null || m_DontDestroyOnLoadLabel == null)
            {
                m_Initialized = false;
            }


            InitLobby();

            if (!m_Initialized)
            {
                m_LobbySceneLabel = new GUIContent("Lobby Scene", "The scene loaded for the lobby");
                //m_PlaySceneLabel = new GUIContent("Play Scene", "The scene loaded to play the game");
                m_MaxPlayersLabel = new GUIContent("Max Players", "The maximum number of players allowed in the lobby.");
                m_MaxPlayersPerConnectionLabel = new GUIContent("Max Players Per Connection", "The maximum number of players that each connection/client can have in the lobby. Defaults to 1.");
                m_MinPlayersLabel = new GUIContent("Minimum Players", "The minimum number of players required to be ready for the game to start. If this is zero then the game can start with any number of players.");
                //m_ShowLobbyGUIProperty = serializedObject.FindProperty("m_ShowLobbyGUI");
                m_MaxPlayersProperty = serializedObject.FindProperty("m_MaxPlayers");
                m_MaxPlayersPerConnectionProperty = serializedObject.FindProperty("m_MaxPlayersPerConnection");
                m_MinPlayersProperty        = serializedObject.FindProperty("m_MinPlayers");
                m_LobbyPlayerPrefabProperty = serializedObject.FindProperty("m_LobbyPlayerPrefab");



                //m_GamePlayerPrefabProperty = serializedObject.FindProperty("m_GamePlayerPrefab");
                m_GamePlayerPrefabProperty = serializedObject.FindProperty("m_GamePlayerPrefab");
                EditorGUI.BeginChangeCheck();
                EditorGUILayout.PropertyField(m_GamePlayerPrefabProperty, true);
                if (EditorGUI.EndChangeCheck())
                {
                    serializedObject.ApplyModifiedProperties();
                }
            }
            Init();



            var lobby = target as NetworkLobbyManager;

            if (lobby == null)
            {
                return;
            }
            serializedObject.Update();
            ShowLobbyScenes();
            EditorGUILayout.PropertyField(m_LobbyPlayerPrefabProperty);
            EditorGUI.BeginChangeCheck();
            var newGamPlayer = EditorGUILayout.ObjectField("Game Player Prefab", lobby.gamePlayerPrefab, typeof(NetworkIdentity), false);

            if (EditorGUI.EndChangeCheck())
            {
                if (newGamPlayer == null)
                {
                    m_GamePlayerPrefabProperty.objectReferenceValue = null;
                }
                else
                {
                    var newGamePlayerIdentity = newGamPlayer as NetworkIdentity;
                    if (newGamePlayerIdentity != null)
                    {
                        if (newGamePlayerIdentity.gameObject != lobby.gamePlayerPrefab)
                        {
                            m_GamePlayerPrefabProperty.objectReferenceValue = newGamePlayerIdentity.gameObject;
                        }
                    }
                }
            }



            EditorGUILayout.PropertyField(m_DontDestroyOnLoadProperty, m_DontDestroyOnLoadLabel);
            EditorGUILayout.PropertyField(m_RunInBackgroundProperty, m_RunInBackgroundLabel);
            EditorGUILayout.PropertyField(m_MaxPlayersProperty, m_MaxPlayersLabel);
            EditorGUILayout.PropertyField(m_MaxPlayersPerConnectionProperty, m_MaxPlayersPerConnectionLabel);
            EditorGUILayout.PropertyField(m_MinPlayersProperty, m_MinPlayersLabel);
            if (EditorGUILayout.PropertyField(m_LogLevelProperty))
            {
                LogFilter.currentLogLevel = (int)m_NetworkManager.logLevel;
            }
            ShowConfigInfo();
            ShowSimulatorInfo();
            ShowNetworkInfo();
            ShowSpawnInfo();
            serializedObject.ApplyModifiedProperties();


            EditorGUILayout.EndVertical();

            EditorGUILayout.Separator();
            //EditorGUILayout.PropertyField(m_ShowLobbyGUIProperty);
            if (!Application.isPlaying)
            {
                return;
            }
            ShowLobbySlots();
            //ShowDerivedProperties(typeof(NetworkLobbyManager), typeof(NetworkManager));
        }
    void ShowSplatmaps()
    {
        LandmassEditorUtilities editorUtilities = LandmassEditorUtilities.Instance;
        ImporterConfiguration   importCfg       = editorUtilities.ImportCfg;

        EGL.BeginVertical();
        {
            GUILayout.Label("The settings for processing splatmaps.");

            EGL.Separator();

            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                GUILayout.Label("Postfix for splatmap files.");
                importCfg.SplatmapTag = EGL.TextField("Name postfix", importCfg.SplatmapTag);
            }
            EGL.EndVertical();

            EGL.Separator();

            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                GUILayout.Label("Splatmap file specifications. Please use x^2.");
                importCfg.SplatmapExtention = EGL.TextField("File extention", importCfg.SplatmapExtention);
                importCfg.SplatmapFlipX     = EGL.Toggle("Mirror X", importCfg.SplatmapFlipX);
                importCfg.SplatmapFlipY     = EGL.Toggle("Mirror Y", importCfg.SplatmapFlipY);
                importCfg.TrimEmptyChannels = EGL.Toggle("Trim empty", importCfg.TrimEmptyChannels);
                importCfg.NormalizationMode = (NormalizationMode)EditorGUILayout.EnumPopup("Normalize mode", importCfg.NormalizationMode);
            }
            EGL.EndVertical();

            EGL.Separator();

            EGL.BeginVertical(GuiUtils.Skin.box);
            {
                GUILayout.Label("The textures to assign. (Current count: " + editorUtilities.SplatPrototypes.Count + ")");

                EGL.Separator();

                EGL.BeginHorizontal();
                {
                    if (editorUtilities.SplatPrototypes.Count >= 8)
                    {
                        GUI.enabled = false;
                    }
                    if (GUILayout.Button("Add Prototype"))
                    {
                        editorUtilities.SplatPrototypes.Add(new SplatPrototype());
                        importCfg.IsDirty = true; // Todo: Nasty
                    }
                    GUI.enabled = true;

                    if (GUILayout.Button("Grab from Selected Terrain Object or Asset"))
                    {
                        GetPrototypesFromSelectedTerrain();
                        importCfg.IsDirty = true; // Todo: Nasty
                    }
                }
                EGL.EndHorizontal();

                // Show the list
                EGL.BeginVertical();
                {
                    _prototypeScrollPos = EGL.BeginScrollView(_prototypeScrollPos, GUILayout.MinHeight(96f), GUILayout.MaxHeight(Screen.height));
                    {
                        List <SplatPrototype> removeThese = new List <SplatPrototype>();
                        int i = 0;
                        foreach (SplatPrototype splatPrototype in editorUtilities.SplatPrototypes)
                        {
                            if (ShowSplatPrototype(splatPrototype, i))
                            {
                                removeThese.Add(splatPrototype);
                                importCfg.IsDirty = true; // Nasty
                            }
                            i++;
                        }
                        foreach (SplatPrototype splatPrototype in removeThese)
                        {
                            editorUtilities.SplatPrototypes.Remove(splatPrototype);
                        }
                    }
                    EGL.EndScrollView();
                }
                EGL.EndVertical();
            }
            EGL.EndVertical();
        }
        EGL.EndVertical();
    }
 private void DrawControls()
 {
     if ((Object)this.m_Manager == (Object)null)
     {
         return;
     }
     EditorGUI.BeginChangeCheck();
     EditorGUILayout.PropertyField(this.m_HostMigrationProperty, this.m_HostMigrationLabel, new GUILayoutOption[0]);
     EditorGUILayout.PropertyField(this.m_ShowGUIProperty);
     if (this.m_Manager.showGUI)
     {
         EditorGUILayout.PropertyField(this.m_OffsetXProperty);
         EditorGUILayout.PropertyField(this.m_OffsetYProperty);
     }
     if (EditorGUI.EndChangeCheck())
     {
         this.serializedObject.ApplyModifiedProperties();
     }
     if (!Application.isPlaying)
     {
         return;
     }
     EditorGUILayout.Separator();
     EditorGUILayout.LabelField("Disconnected From Host", this.m_Manager.disconnectedFromHost.ToString(), new GUILayoutOption[0]);
     EditorGUILayout.LabelField("Waiting to become New Host", this.m_Manager.waitingToBecomeNewHost.ToString(), new GUILayoutOption[0]);
     EditorGUILayout.LabelField("Waitingto Reconnect to New Host", this.m_Manager.waitingReconnectToNewHost.ToString(), new GUILayoutOption[0]);
     EditorGUILayout.LabelField("Your ConnectionId", this.m_Manager.oldServerConnectionId.ToString(), new GUILayoutOption[0]);
     EditorGUILayout.LabelField("New Host Address", this.m_Manager.newHostAddress, new GUILayoutOption[0]);
     if (this.m_Manager.peers != null)
     {
         this.m_ShowPeers = EditorGUILayout.Foldout(this.m_ShowPeers, "Peers");
         if (this.m_ShowPeers)
         {
             ++EditorGUI.indentLevel;
             foreach (PeerInfoMessage peer in this.m_Manager.peers)
             {
                 EditorGUILayout.LabelField("Peer: ", peer.ToString(), new GUILayoutOption[0]);
             }
             --EditorGUI.indentLevel;
         }
     }
     if (this.m_Manager.pendingPlayers == null)
     {
         return;
     }
     this.m_ShowPlayers = EditorGUILayout.Foldout(this.m_ShowPlayers, "Pending Players");
     if (!this.m_ShowPlayers)
     {
         return;
     }
     ++EditorGUI.indentLevel;
     using (Dictionary <int, NetworkMigrationManager.ConnectionPendingPlayers> .KeyCollection.Enumerator enumerator1 = this.m_Manager.pendingPlayers.Keys.GetEnumerator())
     {
         while (enumerator1.MoveNext())
         {
             int current1 = enumerator1.Current;
             EditorGUILayout.LabelField("Connection: ", current1.ToString(), new GUILayoutOption[0]);
             ++EditorGUI.indentLevel;
             using (List <NetworkMigrationManager.PendingPlayerInfo> .Enumerator enumerator2 = this.m_Manager.pendingPlayers[current1].players.GetEnumerator())
             {
                 while (enumerator2.MoveNext())
                 {
                     NetworkMigrationManager.PendingPlayerInfo current2 = enumerator2.Current;
                     EditorGUILayout.ObjectField("Player netId:" + (object)current2.netId + " contId:" + (object)current2.playerControllerId, (Object)current2.obj, typeof(GameObject), false, new GUILayoutOption[0]);
                 }
             }
             --EditorGUI.indentLevel;
         }
     }
     --EditorGUI.indentLevel;
 }
Ejemplo n.º 14
0
        public override void OnInspectorGUI()
        {
            if (styles == null)
            {
                // Set the singleton in case the DrawEditors() has created this window
                s_SharedAssetStoreAssetInspector = this;
                styles = new Styles();
            }

            AssetStoreAsset activeAsset = AssetStoreAssetSelection.GetFirstAsset();

            AssetStoreAsset.PreviewInfo info = null;
            if (activeAsset != null)
            {
                info = activeAsset.previewInfo;
            }

            if (activeAsset != null)
            {
                target.name = string.Format("Asset Store: {0}", activeAsset.name);
            }
            else
            {
                target.name = "Asset Store";
            }

            EditorGUILayout.BeginVertical();

            bool guiEnabled = GUI.enabled;

            GUI.enabled = activeAsset != null && activeAsset.packageID != 0;

            if (OfflineNoticeEnabled)
            {
                Color col = GUI.color;
                GUI.color = Color.yellow;
                GUILayout.Label("Network is offline");
                GUI.color = col;
            }

            if (activeAsset != null)
            {
                string typeName  = activeAsset.className == null ? "" : activeAsset.className.Split(new char[] { ' ' }, 2)[0];
                bool   isPackage = activeAsset.id == -activeAsset.packageID;
                if (isPackage)
                {
                    typeName = "Package";
                }
                if (activeAsset.HasLivePreview)
                {
                    typeName = activeAsset.Preview.GetType().Name;
                }
                EditorGUILayout.LabelField("Type", typeName);

                if (isPackage)
                {
                    packageInfoShown = true;
                }
                else
                {
                    EditorGUILayout.Separator();
                    packageInfoShown = EditorGUILayout.Foldout(packageInfoShown, "Part of package", true);
                }
                if (packageInfoShown)
                {
                    EditorGUILayout.LabelField("Name", info == null ? "-" : info.packageName);
                    EditorGUILayout.LabelField("Version", info == null ? "-" : info.packageVersion);
                    string price = info == null ? "-" : (!string.IsNullOrEmpty(activeAsset.price) ? activeAsset.price : "free");
                    EditorGUILayout.LabelField("Price", price);
                    string rating = info != null && info.packageRating >= 0 ? info.packageRating + " of 5" : "-";
                    EditorGUILayout.LabelField("Rating", rating);
                    EditorGUILayout.LabelField("Size", info == null ? "-" : intToSizeString(info.packageSize));
                    string assetCount = info != null && info.packageAssetCount >= 0 ? info.packageAssetCount.ToString() : "-";
                    EditorGUILayout.LabelField("Asset count", assetCount);
                    GUILayout.BeginHorizontal();
                    EditorGUILayout.PrefixLabel("Web page");
                    bool hasPageUrl = info != null && info.packageShortUrl != null && info.packageShortUrl != "";
                    bool guiBefore  = GUI.enabled;
                    GUI.enabled = hasPageUrl;

                    if (GUILayout.Button(hasPageUrl ? new GUIContent(info.packageShortUrl, "View in browser") : EditorGUIUtility.TempContent("-"), styles.link))
                    {
                        Application.OpenURL(info.packageShortUrl);
                    }
                    if (GUI.enabled)
                    {
                        EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), MouseCursor.Link);
                    }
                    GUI.enabled = guiBefore;
                    GUILayout.EndHorizontal();
                    EditorGUILayout.LabelField("Publisher", info == null ? "-" : info.publisherName);
                }

                if (activeAsset.id != 0)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.FlexibleSpace();

                    string actionLabel;
                    if (info != null && info.isDownloadable)
                    {
                        actionLabel = "Import package";
                    }
                    else
                    {
                        actionLabel = "Buy for " + activeAsset.price;
                    }

                    bool lastEnabled = GUI.enabled;
                    bool building    = info != null && info.buildProgress >= 0;
                    bool downloading = info != null && info.downloadProgress >= 0;
                    if (building || downloading || info == null)
                    {
                        actionLabel = "";
                        GUI.enabled = false;
                    }

                    if (GUILayout.Button(actionLabel, GUILayout.Height(40), GUILayout.Width(120)))
                    {
                        if (info != null && info.isDownloadable)
                        {
                            ImportPackage(activeAsset);
                        }
                        else
                        {
                            InitiateBuySelected();
                        }
                        GUIUtility.ExitGUI();
                    }

                    Rect r;
                    if (Event.current.type == EventType.Repaint)
                    {
                        r         = GUILayoutUtility.GetLastRect();
                        r.height -= 4;
                        float width = r.width;
                        r.width = r.height;
                        r.y    += 2;
                        r.x    += 2;

                        if (building || downloading)
                        {
                            r.width = width - r.height - 4;
                            r.x    += r.height;
                            EditorGUI.ProgressBar(r,
                                                  downloading ? info.downloadProgress : info.buildProgress,
                                                  downloading ? "Downloading" : "Building");
                        }
                    }

                    GUI.enabled = lastEnabled;
                    GUILayout.Space(4);

                    if (GUILayout.Button("Open Asset Store", GUILayout.Height(40), GUILayout.Width(120)))
                    {
                        OpenItemInAssetStore(activeAsset);
                        GUIUtility.ExitGUI();
                    }
                    GUILayout.FlexibleSpace();
                    GUILayout.EndHorizontal();
                }
                GUILayout.FlexibleSpace();
            }
            EditorWrapper editor = previewEditor;

            if (editor != null && activeAsset != null && activeAsset.HasLivePreview)
            {
                editor.OnAssetStoreInspectorGUI();
            }

            GUI.enabled = guiEnabled;

            EditorGUILayout.EndVertical();
        }
 public override void OnInspectorGUI()
 {
     if (this.m_ServerOnlyProperty == null)
     {
         this.m_Initialized = false;
     }
     this.Init();
     this.serializedObject.Update();
     if (this.m_ServerOnlyProperty.boolValue)
     {
         EditorGUILayout.PropertyField(this.m_ServerOnlyProperty, this.m_ServerOnlyLabel, new GUILayoutOption[0]);
         EditorGUILayout.LabelField("Local Player Authority cannot be set for server-only objects");
     }
     else if (this.m_LocalPlayerAuthorityProperty.boolValue)
     {
         EditorGUILayout.LabelField("Server Only cannot be set for Local Player Authority objects");
         EditorGUILayout.PropertyField(this.m_LocalPlayerAuthorityProperty, this.m_LocalPlayerAuthorityLabel, new GUILayoutOption[0]);
     }
     else
     {
         EditorGUILayout.PropertyField(this.m_ServerOnlyProperty, this.m_ServerOnlyLabel, new GUILayoutOption[0]);
         EditorGUILayout.PropertyField(this.m_LocalPlayerAuthorityProperty, this.m_LocalPlayerAuthorityLabel, new GUILayoutOption[0]);
     }
     this.serializedObject.ApplyModifiedProperties();
     if (!Application.isPlaying)
     {
         return;
     }
     EditorGUILayout.Separator();
     if (this.m_NetworkIdentity.observers != null && this.m_NetworkIdentity.observers.Count > 0)
     {
         this.m_ShowObservers = EditorGUILayout.Foldout(this.m_ShowObservers, "Observers");
         if (this.m_ShowObservers)
         {
             ++EditorGUI.indentLevel;
             foreach (NetworkConnection observer in this.m_NetworkIdentity.observers)
             {
                 GameObject gameObject = (GameObject)null;
                 using (List <PlayerController> .Enumerator enumerator = observer.playerControllers.GetEnumerator())
                 {
                     while (enumerator.MoveNext())
                     {
                         PlayerController current = enumerator.Current;
                         if (current != null)
                         {
                             gameObject = current.gameObject;
                             break;
                         }
                     }
                 }
                 if ((bool)((Object)gameObject))
                 {
                     EditorGUILayout.ObjectField("Connection " + (object)observer.connectionId, (Object)gameObject, typeof(GameObject), false, new GUILayoutOption[0]);
                 }
                 else
                 {
                     EditorGUILayout.TextField("Connection " + (object)observer.connectionId);
                 }
             }
             --EditorGUI.indentLevel;
         }
     }
     if (PrefabUtility.GetPrefabType((Object)this.m_NetworkIdentity.gameObject) == PrefabType.Prefab || !this.m_NetworkIdentity.gameObject.activeSelf || (!this.m_NetworkIdentity.netId.IsEmpty() || !NetworkServer.active))
     {
         return;
     }
     EditorGUILayout.BeginHorizontal();
     EditorGUILayout.LabelField(this.m_SpawnLabel);
     if (GUILayout.Toggle(false, "Spawn", EditorStyles.miniButtonLeft, new GUILayoutOption[0]))
     {
         NetworkServer.Spawn(this.m_NetworkIdentity.gameObject);
         EditorUtility.SetDirty(this.target);
     }
     EditorGUILayout.EndHorizontal();
 }
Ejemplo n.º 16
0
        void DrawControls()
        {
            EditorGUI.BeginChangeCheck();
            EditorGUILayout.PropertyField(m_AnimatorProperty, m_AnimatorLabel);
            if (EditorGUI.EndChangeCheck())
            {
                m_AnimSync.ResetParameterOptions();
            }

            if (m_AnimSync.animator == null)
            {
                return;
            }

            var controller = m_AnimSync.animator.runtimeAnimatorController as AnimatorController;

            if (controller != null)
            {
                var showWarning = false;
                EditorGUI.indentLevel += 1;
                int i = 0;

                foreach (var p in controller.parameters)
                {
                    if (i >= 32)
                    {
                        showWarning = true;
                        break;
                    }

                    bool oldSend = m_AnimSync.GetParameterAutoSend(i);
                    bool send    = EditorGUILayout.Toggle(p.name, oldSend);
                    if (send != oldSend)
                    {
                        m_AnimSync.SetParameterAutoSend(i, send);
                        EditorUtility.SetDirty(target);
                    }
                    i += 1;
                }

                if (showWarning)
                {
                    EditorGUILayout.HelpBox("NetworkAnimator can only select between the first 32 parameters in a mecanim controller", MessageType.Warning);
                }

                EditorGUI.indentLevel -= 1;
            }

            if (Application.isPlaying)
            {
                EditorGUILayout.Separator();
                if (m_AnimSync.param0 != "")
                {
                    EditorGUILayout.LabelField("Param 0", m_AnimSync.param0);
                }
                if (m_AnimSync.param1 != "")
                {
                    EditorGUILayout.LabelField("Param 1", m_AnimSync.param1);
                }
                if (m_AnimSync.param2 != "")
                {
                    EditorGUILayout.LabelField("Param 2", m_AnimSync.param2);
                }
                if (m_AnimSync.param3 != "")
                {
                    EditorGUILayout.LabelField("Param 3", m_AnimSync.param3);
                }
                if (m_AnimSync.param4 != "")
                {
                    EditorGUILayout.LabelField("Param 4", m_AnimSync.param4);
                }
            }
        }
Ejemplo n.º 17
0
        public override void OnInspectorGUI()
        {
            if (m_ServerOnlyProperty == null)
            {
                m_Initialized = false;
            }

            Init();

            serializedObject.Update();

            if (m_ServerOnlyProperty.boolValue)
            {
                EditorGUILayout.PropertyField(m_ServerOnlyProperty, m_ServerOnlyLabel);
                EditorGUILayout.LabelField("Local Player Authority cannot be set for server-only objects");
            }
            else if (m_LocalPlayerAuthorityProperty.boolValue)
            {
                EditorGUILayout.LabelField("Server Only cannot be set for Local Player Authority objects");
                EditorGUILayout.PropertyField(m_LocalPlayerAuthorityProperty, m_LocalPlayerAuthorityLabel);
            }
            else
            {
                EditorGUILayout.PropertyField(m_ServerOnlyProperty, m_ServerOnlyLabel);
                EditorGUILayout.PropertyField(m_LocalPlayerAuthorityProperty, m_LocalPlayerAuthorityLabel);
            }

            serializedObject.ApplyModifiedProperties();

            if (!Application.isPlaying)
            {
                return;
            }

            // Runtime actions below here

            EditorGUILayout.Separator();

            if (m_NetworkIdentity.observers != null && m_NetworkIdentity.observers.Count > 0)
            {
                m_ShowObservers = EditorGUILayout.Foldout(m_ShowObservers, "Observers");
                if (m_ShowObservers)
                {
                    EditorGUI.indentLevel += 1;
                    foreach (var o in m_NetworkIdentity.observers)
                    {
                        GameObject obj = null;
                        foreach (var p in o.playerControllers)
                        {
                            if (p != null)
                            {
                                obj = p.gameObject;
                                break;
                            }
                        }
                        if (obj)
                        {
                            EditorGUILayout.ObjectField("Connection " + o.connectionId, obj, typeof(GameObject), false);
                        }
                        else
                        {
                            EditorGUILayout.TextField("Connection " + o.connectionId);
                        }
                    }
                    EditorGUI.indentLevel -= 1;
                }
            }

            PrefabType prefabType = PrefabUtility.GetPrefabType(m_NetworkIdentity.gameObject);

            if (prefabType == PrefabType.Prefab)
            {
                return;
            }

            if (m_NetworkIdentity.gameObject.activeSelf && m_NetworkIdentity.netId.IsEmpty() && NetworkServer.active)
            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField(m_SpawnLabel);
                if (GUILayout.Toggle(false, "Spawn", EditorStyles.miniButtonLeft))
                {
                    NetworkServer.Spawn(m_NetworkIdentity.gameObject, m_NetworkIdentity.groupId);
                    EditorUtility.SetDirty(target);  // preview window STILL doens't update immediately..
                }
                EditorGUILayout.EndHorizontal();
            }
        }
Ejemplo n.º 18
0
 public override void OnInspectorGUI()
 {
     EGL.LabelField("已有道具:");
     items = ItemXmlManager.XmlReader.FindItems();
     for (int i = 0; i < items.Count; i++)
     {
         EGL.BeginHorizontal();
         EGL.LabelField(items[i]);
         if (!tryToAddNewItem && tryToModify == -1)
         {
             if (GUILayout.Button("修改"))
             {
                 tryToModify = i;
                 sm.LoadItemClassInfo(items[tryToModify]);
                 so.Update();
             }
             if (GUILayout.Button("删除"))
             {
                 sm.DeleteItemClass(items[i]);
                 so.Update();
             }
         }
         EGL.EndHorizontal();
     }
     if (tryToModify == -1 && tryToAddNewItem == false)
     {
         EGL.Separator();
         EGL.Separator();
         EGL.Separator();
         EGL.Separator();
         if (GUILayout.Button("添加一个新道具"))
         {
             tryToAddNewItem = true;
             sm.GetNewItemTemplate();
             so.Update();
         }
     }
     if (tryToModify != -1)
     {
         tryToAddNewItem = false;
         EGL.Separator();
         EGL.Separator();
         EGL.LabelField("类名:  " + items[tryToModify]);
         EGL.PropertyField(newItemName, new GUIContent("道具名字"));
         EGL.PropertyField(resources, new GUIContent("道具预置体"));
         EGL.LabelField("该预置体必须处于\"Resource/ItemPrefabs\"文件夹下!");
         EGL.BeginHorizontal();
         EGL.PropertyField(parameterName, new GUIContent("参数名字"), true);
         EGL.PropertyField(parameterValue, new GUIContent("参数值"), true);
         EGL.EndHorizontal();
         EGL.BeginHorizontal();
         if (GUILayout.Button("应用"))
         {
             so.ApplyModifiedProperties();
             sm.ModifyItem(items[tryToModify]);
             so.Update();
             tryToModify = -1;
         }
         if (GUILayout.Button("取消"))
         {
             tryToModify = -1;
         }
         EGL.EndHorizontal();
     }
     if (tryToAddNewItem)
     {
         EGL.Separator();
         EGL.Separator();
         EGL.PropertyField(newItemClassName, new GUIContent("类名"));
         EGL.PropertyField(newItemName, new GUIContent("道具名字"));
         EGL.PropertyField(resources, new GUIContent("道具预置体"));
         EGL.LabelField("该预置体必须处于\"Resource/ItemPrefabs\"文件夹下!");
         EGL.BeginHorizontal();
         EGL.PropertyField(parameterName, new GUIContent("参数名字"), true);
         EGL.PropertyField(parameterValue, new GUIContent("参数值"), true);
         EGL.EndHorizontal();
         EGL.BeginHorizontal();
         if (GUILayout.Button("应用"))
         {
             so.ApplyModifiedProperties();
             if (sm.CreateNewItemClass())
             {
                 tryToAddNewItem = false;
                 msg             = "";
             }
             else
             {
                 msg = "请先删除重名类!或更改一个新类名";
             }
         }
         if (GUILayout.Button("取消"))
         {
             tryToAddNewItem = false;
             msg             = "";
         }
         EGL.EndHorizontal();
     }
     EGL.LabelField(msg);
 }
Ejemplo n.º 19
0
 public override void OnInspectorGUI()
 {
     EGL.LabelField("已有技能:");
     skills = XmlManager.XmlReader.FindSkills();
     for (int i = 0; i < skills.Count; i++)
     {
         EGL.BeginHorizontal();
         EGL.LabelField(skills[i]);
         if (!tryToAddNewSkill && tryToModify == -1)
         {
             if (GUILayout.Button("修改"))
             {
                 tryToModify = i;
                 sm.LoadSkillClassInfo(skills[tryToModify]);
                 so.Update();
             }
             if (GUILayout.Button("删除"))
             {
                 sm.DeleteSkillClass(skills[i]);
                 so.Update();
             }
         }
         EGL.EndHorizontal();
     }
     if (tryToModify == -1 && tryToAddNewSkill == false)
     {
         EGL.Separator();
         EGL.Separator();
         EGL.Separator();
         EGL.Separator();
         if (GUILayout.Button("添加一个新技能"))
         {
             tryToAddNewSkill = true;
             sm.GetNewSkillTemplate();
             so.Update();
         }
     }
     if (tryToModify != -1)
     {
         tryToAddNewSkill = false;
         EGL.Separator();
         EGL.Separator();
         EGL.LabelField("类名:  " + skills[tryToModify]);
         EGL.PropertyField(newSkillName, new GUIContent("技能名字"));
         EGL.PropertyField(resources, new GUIContent("技能预置体"));
         EGL.LabelField("该预置体必须处于\"Resource/SkillPerferbs\"文件夹下!");
         EGL.BeginHorizontal();
         EGL.PropertyField(parameterName, new GUIContent("参数名字"), true);
         EGL.PropertyField(parameterValue, new GUIContent("参数值"), true);
         EGL.EndHorizontal();
         EGL.BeginHorizontal();
         if (GUILayout.Button("应用"))
         {
             so.ApplyModifiedProperties();
             sm.ModifySkill(skills[tryToModify]);
             so.Update();
             tryToModify = -1;
         }
         if (GUILayout.Button("取消"))
         {
             tryToModify = -1;
         }
         EGL.EndHorizontal();
     }
     if (tryToAddNewSkill)
     {
         EGL.Separator();
         EGL.Separator();
         EGL.PropertyField(newSkillClassName, new GUIContent("类名"));
         EGL.PropertyField(newSkillName, new GUIContent("技能名字"));
         EGL.PropertyField(resources, new GUIContent("技能预置体"));
         EGL.LabelField("该预置体必须处于\"Resource/SkillPerferbs\"文件夹下!");
         EGL.BeginHorizontal();
         EGL.PropertyField(parameterName, new GUIContent("参数名字"), true);
         EGL.PropertyField(parameterValue, new GUIContent("参数值"), true);
         EGL.EndHorizontal();
         EGL.BeginHorizontal();
         if (GUILayout.Button("应用"))
         {
             so.ApplyModifiedProperties();
             if (sm.CreateNewSkillClass())
             {
                 tryToAddNewSkill = false;
                 msg = "";
             }
             else
             {
                 msg = "请先删除重名类!或更改一个新类名";
             }
         }
         if (GUILayout.Button("取消"))
         {
             tryToAddNewSkill = false;
             msg = "";
         }
         EGL.EndHorizontal();
     }
     EGL.LabelField(msg);
 }