UnityEngine.GUILayout.Toolbar(int, UnityEngine.GUIContent[], UnityEngine.GUIStyle, params UnityEngine.GUILayoutOption[])

Here are the examples of the csharp api UnityEngine.GUILayout.Toolbar(int, UnityEngine.GUIContent[], UnityEngine.GUIStyle, params UnityEngine.GUILayoutOption[]) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

32 Examples 7

19 View Source File : CheckResources.cs
License : Apache License 2.0
Project Creator : 365082218

void OnGUI ()
		{
				if (GUILayout.Button ("Refresh"))
						CheckResources ();
				GUILayout.BeginHorizontal ();
				GUILayout.Label ("Materials " + ActiveMaterials.Count);
				GUILayout.Label ("Textures " + ActiveTextures.Count + " - " + FormatSizeString (TotalTextureMemory));
				GUILayout.Label ("Meshes " + ActiveMeshDetails.Count + " - " + TotalMeshVertices + " verts");
				GUILayout.EndHorizontal ();
				ActiveInspectType = (InspectType)GUILayout.Toolbar ((int)ActiveInspectType, inspectToolbarStrings);
		
				ctrlPressed = Event.current.control || Event.current.command;
		
				switch (ActiveInspectType) {
				case InspectType.Textures:
						ListTextures ();
						break;
				case InspectType.Materials:
						ListMaterials ();
						break;
				case InspectType.Meshes:
						ListMeshes ();
						break;	
			
			
				}
		}

19 View Source File : NoiseEditor.cs
License : MIT License
Project Creator : adrianpolimeni

void DrawShapeMenu() {
            shapeTab = GUILayout.Toolbar(shapeTab, new string[] { "Low", "Medium", "High", "Highest" });
            noise.activeChannel = (Noise.NoiseChannel)shapeTab;
            DrawChannelMenu(0, shapeTab);
        }

19 View Source File : NoiseEditor.cs
License : MIT License
Project Creator : adrianpolimeni

void DrawDetailMenu()
        {
            detailTab = GUILayout.Toolbar(detailTab, new string[] { "Low", "Medium", "High"});
            noise.activeChannel = (Noise.NoiseChannel)detailTab;
            DrawChannelMenu(1, detailTab);
        }

19 View Source File : CloudSettingsEditor.cs
License : MIT License
Project Creator : adrianpolimeni

public override void OnInspectorGUI()
        {
          
            settings = (CloudSettings)target;

            tab = GUILayout.Toolbar(tab, new string[] { "Noise", "Ray-March", "Lighting", "Movement" });
            switch (tab)
            {
                case 0:
                    DrawNoiseMenu();
                    break;
                case 1:
                    DrawRayMarchMenu();
                    break;
                case 2:
                    DrawLightingMenu();
                    break;
                case 3:
                    DrawMovementMenu();
                    break;
            }
            SceneView.RepaintAll();
        }

19 View Source File : NoiseEditor.cs
License : MIT License
Project Creator : adrianpolimeni

public override void OnInspectorGUI()
        {
            noise = (Noise)target;
            texTab = GUILayout.Toolbar(texTab, new string[] { "Shape", "Detail" });
            noise.activeTextureType = (Noise.NoiseType)texTab;
            switch (texTab)
            {
                case 0:
                    DrawShapeMenu();
                    break;
                case 1:
                    DrawDetailMenu();
                    break;
            }
            if (defaultFoldout = EditorGUILayout.Foldout(defaultFoldout, "Shader Setup"))
            {
                DrawDefaultInspector();
            }
            if (GUILayout.Button("Save Noise Settings")) {
                noise.SaveSettings();
            }
        }

19 View Source File : EntryPoint.cs
License : MIT License
Project Creator : Astropilot

void ValheimToolerWindow(int windowID)
        {
            GUILayout.Space(10);

            _windowToolbar = (WindowToolbar)GUILayout.Toolbar((int)_windowToolbar, _toolbarChoices.Select(choice => VTLocalization.instance.Localize(choice)).ToArray());

            switch (_windowToolbar)
            {
                case WindowToolbar.PLAYER:
                    PlayerHacks.DisplayGUI();
                    break;
                case WindowToolbar.ENreplacedIES_ITEMS:
                    EnreplacediesItemsHacks.DisplayGUI();
                    break;
                case WindowToolbar.MISC:
                    MiscHacks.DisplayGUI();
                    break;
            }

            GUI.DragWindow();
        }

19 View Source File : TestRunnerWindow.cs
License : MIT License
Project Creator : BattleDawnNZ

public void OnGUI()
        {
            if (!m_Enabled)
            {
                Enable();
            }

            if (BuildPipeline.isBuildingPlayer)
            {
                m_IsBuilding = true;
            }
            else if (m_IsBuilding)
            {
                m_IsBuilding = false;
                Repaint();
            }

            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            var selectedIndex = m_TestTypeToolbarIndex;
            m_TestTypeToolbarIndex = GUILayout.Toolbar(m_TestTypeToolbarIndex, Enum.GetNames(typeof(TestRunnerMenuLabels)), "LargeButton", UnityEngine.GUI.ToolbarButtonSize.FitToContents);
            GUILayout.FlexibleSpace();
            EditorGUILayout.EndHorizontal();

            if (selectedIndex != m_TestTypeToolbarIndex)
            {
                SelectTestListGUI(m_TestTypeToolbarIndex);
                StartRetrieveTestList();
            }

            EditorGUILayout.BeginVertical();
            using (new EditorGUI.DisabledScope(EditorApplication.isPlayingOrWillChangePlaymode))
            {
                m_SelectedTestTypes.PrintHeadPanel();
            }
            EditorGUILayout.EndVertical();

            if (m_Settings.verticalSplit)
                SplitterGUILayout.BeginVerticalSplit(m_Spl);
            else
                SplitterGUILayout.BeginHorizontalSplit(m_Spl);

            EditorGUILayout.BeginVertical();
            EditorGUILayout.BeginVertical(Styles.testList);
            m_SelectedTestTypes.RenderTestList();
            EditorGUILayout.EndVertical();
            EditorGUILayout.EndVertical();

            m_SelectedTestTypes.RenderDetails();

            if (m_Settings.verticalSplit)
                SplitterGUILayout.EndVerticalSplit();
            else
                SplitterGUILayout.EndHorizontalSplit();
        }

19 View Source File : AnimationTrackInspector.cs
License : MIT License
Project Creator : BattleDawnNZ

public static void ShowMotionOffsetEditModeToolbar(ref TimelineAnimationUtilities.OffsetEditMode motionOffset)
        {
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.FlexibleSpace();

            int newMotionOffsetMode = GUILayout.Toolbar((int)motionOffset, new[] { Styles.PositionIcon, Styles.RotationIcon });

            if (GUI.changed)
            {
                if ((int)motionOffset == newMotionOffsetMode) //untoggle the button
                    motionOffset = TimelineAnimationUtilities.OffsetEditMode.None;
                else
                    motionOffset = (TimelineAnimationUtilities.OffsetEditMode)newMotionOffsetMode;
            }

            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.Space(3);
        }

19 View Source File : SteamVR_Skeleton_PoserEditor.cs
License : GNU General Public License v3.0
Project Creator : brandonmousseau

void DrawPoseEditorMenu()
        {
            if (Application.isPlaying)
            {
                EditorGUILayout.LabelField("Cannot modify pose while in play mode.");
            }
            else
            {
                bool createNew = false;

                LoadDefaultPreviewHands();


                activePoseIndex = previewPoseSelection.intValue;
                if (activePoseIndex == 0)
                    activePoseProp = skeletonMainPoseProperty;
                else
                    activePoseProp = skeletonAdditionalPosesProperty.GetArrayElementAtIndex(activePoseIndex - 1);


                //box containing all pose editing controls
                GUILayout.BeginVertical("box");


                poseEditorExpanded.boolValue = IndentedFoldoutHeader(poseEditorExpanded.boolValue, "Pose Editor");


                if (poseEditorExpanded.boolValue)
                {
                    //show selectable menu of all poses, highlighting the one that is selected
                    EditorGUILayout.Space();


                    poser.poseNames = new string[skeletonAdditionalPosesProperty.arraySize + 1];

                    for (int i = 0; i < skeletonAdditionalPosesProperty.arraySize + 1; i++)
                    {
                        if (i == 0)
                            // main pose special case
                            poser.poseNames[i] = skeletonMainPoseProperty.objectReferenceValue == null ? "[not set]" : skeletonMainPoseProperty.objectReferenceValue.name + " (MAIN)";
                        else
                            // additional poses from array
                            poser.poseNames[i] = skeletonAdditionalPosesProperty.GetArrayElementAtIndex(i - 1).objectReferenceValue == null ? "[not set]" : skeletonAdditionalPosesProperty.GetArrayElementAtIndex(i - 1).objectReferenceValue.name;
                    }

                    EditorGUILayout.BeginHorizontal();
                    int poseSelected = GUILayout.Toolbar(activePoseIndex, poser.poseNames);

                    if (poseSelected != activePoseIndex)
                    {
                        forceUpdateHands = true;
                        activePoseIndex = poseSelected;
                        PoseChanged = true;
                        previewPoseSelection.intValue = activePoseIndex;
                        serializedObject.ApplyModifiedProperties();
                    }




                    EditorGUILayout.BeginVertical(GUILayout.MaxWidth(32));
                    if (GUILayout.Button("+", GUILayout.MaxWidth(32)))
                    {
                        skeletonAdditionalPosesProperty.InsertArrayElementAtIndex(skeletonAdditionalPosesProperty.arraySize);
                    }
                    //only allow deletion of additional poses
                    EditorGUI.BeginDisabledGroup(skeletonAdditionalPosesProperty.arraySize == 0 || activePoseIndex == 0);
                    if (GUILayout.Button("-", GUILayout.MaxWidth(32)) && skeletonAdditionalPosesProperty.arraySize > 0)
                    {
                        skeletonAdditionalPosesProperty.DeleteArrayElementAtIndex(activePoseIndex - 1);
                        skeletonAdditionalPosesProperty.DeleteArrayElementAtIndex(activePoseIndex - 1);
                        if (activePoseIndex >= skeletonAdditionalPosesProperty.arraySize + 1)
                        {
                            activePoseIndex = skeletonAdditionalPosesProperty.arraySize;
                            previewPoseSelection.intValue = activePoseIndex;
                            return;
                        }
                    }

                    EditorGUI.EndDisabledGroup();
                    EditorGUILayout.EndVertical();
                    GUILayout.FlexibleSpace();

                    EditorGUILayout.EndHorizontal();

                    GUILayout.BeginVertical("box");

                    // sides of pose editor
                    GUILayout.BeginHorizontal();

                    //pose controls
                    GUILayout.BeginVertical(GUILayout.MaxWidth(200));

                    GUILayout.Label("Current Pose:");

                    if (PoseChanged)
                    {
                        PoseChanged = false;
                        forceUpdateHands = true;

                        if (activePoseIndex == 0)
                            activePoseProp = skeletonMainPoseProperty;
                        else
                            activePoseProp = skeletonAdditionalPosesProperty.GetArrayElementAtIndex(activePoseIndex - 1);
                        activePose = (SteamVR_Skeleton_Pose)activePoseProp.objectReferenceValue;

                    }


                    activePose = (SteamVR_Skeleton_Pose)activePoseProp.objectReferenceValue;
                    if (activePoseProp.objectReferenceValue == null)
                    {
                        if (previewLeftInstanceProperty.objectReferenceValue != null)
                            DestroyImmediate(previewLeftInstanceProperty.objectReferenceValue);
                        if (previewRightInstanceProperty.objectReferenceValue != null)
                            DestroyImmediate(previewRightInstanceProperty.objectReferenceValue);

                        EditorGUILayout.BeginHorizontal();
                        activePoseProp.objectReferenceValue = EditorGUILayout.ObjectField(activePoseProp.objectReferenceValue, typeof(SteamVR_Skeleton_Pose), false);
                        if (GUILayout.Button("Create")) createNew = true;
                        EditorGUILayout.EndHorizontal();
                        if (createNew)
                        {
                            string fullPath = EditorUtility.SaveFilePanelInProject("Create New Skeleton Pose", "newPose", "replacedet", "Save file");

                            if (string.IsNullOrEmpty(fullPath) == false)
                            {
                                SteamVR_Skeleton_Pose newPose = ScriptableObject.CreateInstance<SteamVR_Skeleton_Pose>();
                                replacedetDatabase.Createreplacedet(newPose, fullPath);
                                replacedetDatabase.Savereplacedets();

                                activePoseProp.objectReferenceValue = newPose;
                                serializedObject.ApplyModifiedProperties();
                            }
                        }
                    }
                    else
                    {
                        activePoseProp.objectReferenceValue = EditorGUILayout.ObjectField(activePoseProp.objectReferenceValue, typeof(SteamVR_Skeleton_Pose), false);

                        DrawPoseControlButtons();

                        UpdatePreviewHand(previewLeftInstanceProperty, showLeftPreviewProperty, SteamVR_Settings.instance.previewHandLeft, activePose.leftHand, activePose, forceUpdateHands);
                        UpdatePreviewHand(previewRightInstanceProperty, showRightPreviewProperty, SteamVR_Settings.instance.previewHandRight, activePose.rightHand, activePose, forceUpdateHands);

                        forceUpdateHands = false;

                        GUILayout.EndVertical();




                        GUILayout.Space(10);

                        if (handTexL == null)
                            handTexL = (Texture)EditorGUIUtility.Load("replacedets/SteamVR/Input/Editor/Resources/Icons/HandLeftIcon.png");
                        if (handTexR == null)
                            handTexR = (Texture)EditorGUIUtility.Load("replacedets/SteamVR/Input/Editor/Resources/Icons/HandRightIcon.png");


                        //Left Hand

                        GUILayout.Space(32);
                        EditorGUILayout.BeginVertical();
                        EditorGUILayout.BeginVertical("box");
                        EditorGUILayout.BeginHorizontal();
                        GUI.color = new Color(1, 1, 1, showLeftPreviewProperty.boolValue ? 1 : 0.25f);
                        if (GUILayout.Button(handTexL, GUI.skin.label, GUILayout.Width(64), GUILayout.Height(64)))
                        {
                            showLeftPreviewProperty.boolValue = !showLeftPreviewProperty.boolValue;
                            //forceUpdateHands = true;
                        }
                        GUI.color = Color.white;

                        EditorGUIUtility.labelWidth = 48;
                        EditorGUILayout.LabelField("Left Hand", EditorStyles.boldLabel);
                        EditorGUIUtility.labelWidth = 0;
                        GUILayout.FlexibleSpace();
                        EditorGUILayout.EndHorizontal();

                        bool showLeft = showLeftPreviewProperty.boolValue;


                        DrawHand(showLeft, activePose.leftHand, activePose.rightHand, getLeftFromOpposite, showLeftPreviewProperty);
                        EditorGUILayout.EndVertical();
                        EditorGUI.BeginDisabledGroup((showLeftPreviewProperty.boolValue && showRightPreviewProperty.boolValue) == false);
                        getRightFromOpposite = GUILayout.Button("Copy Left pose to Right hand");
                        EditorGUI.EndDisabledGroup();
                        EditorGUILayout.EndVertical();



                        EditorGUILayout.BeginVertical();
                        EditorGUILayout.BeginVertical("box");

                        EditorGUILayout.BeginHorizontal();
                        GUILayout.FlexibleSpace();
                        EditorGUIUtility.labelWidth = 48;
                        EditorGUILayout.LabelField("Right Hand", EditorStyles.boldLabel);
                        EditorGUIUtility.labelWidth = 0;
                        GUI.color = new Color(1, 1, 1, showRightPreviewProperty.boolValue ? 1 : 0.25f);
                        if (GUILayout.Button(handTexR, GUI.skin.label, GUILayout.Width(64), GUILayout.Height(64)))
                        {
                            showRightPreviewProperty.boolValue = !showRightPreviewProperty.boolValue;
                            //forceUpdateHands = true;
                        }
                        GUI.color = Color.white;
                        EditorGUILayout.EndHorizontal();

                        bool showRight = showLeftPreviewProperty.boolValue;

                        DrawHand(showRight, activePose.rightHand, activePose.leftHand, getRightFromOpposite, showRightPreviewProperty);
                        EditorGUILayout.EndVertical();
                        EditorGUI.BeginDisabledGroup((showLeftPreviewProperty.boolValue && showRightPreviewProperty.boolValue) == false);
                        getLeftFromOpposite = GUILayout.Button("Copy Right pose to Left hand");
                        EditorGUI.EndDisabledGroup();

                    }







                    /*




                    if (activePoseProp.objectReferenceValue == null)
                    {
                        EditorGUILayout.BeginHorizontal();
                        EditorGUILayout.PropertyField(activePoseProp);
                        createNew = GUILayout.Button("Create");
                        EditorGUILayout.EndHorizontal();
                    }
                    else
                    {
                        EditorGUILayout.PropertyField(activePoseProp);

                        DrawDivider();


                        DrawSaveButtons();

                        if (PoseChanged)
                        {
                            PoseChanged = false;
                            forceUpdateHands = true;
                        }

                        UpdatePreviewHand(previewLeftInstanceProperty, showLeftPreviewProperty, previewLeftHandPrefab, activePose.leftHand, forceUpdateHands);
                        UpdatePreviewHand(previewRightInstanceProperty, showRightPreviewProperty, previewRightHandPrefab, activePose.rightHand, forceUpdateHands);

                    }

                                activePoseProp.objectReferenceValue = newPose;
                                serializedObject.ApplyModifiedProperties();
                            }
                        }
                    */
                    GUILayout.EndVertical();
                    EditorGUILayout.EndVertical();
                    GUILayout.EndHorizontal();


                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.BeginHorizontal();
                    EditorGUIUtility.labelWidth = 120;
                    poserScale.floatValue = EditorGUILayout.FloatField("Preview Pose Scale", poserScale.floatValue);
                    if (poserScale.floatValue <= 0) poserScale.floatValue = 1;
                    EditorGUIUtility.labelWidth = 0;
                    GUILayout.FlexibleSpace();
                    EditorGUILayout.EndHorizontal();
                    if (EditorGUI.EndChangeCheck())
                    {
                        forceUpdateHands = true;
                    }
                }

                GUILayout.EndVertical();
            }
        }

19 View Source File : TestRunnerWindow.cs
License : GNU Lesser General Public License v3.0
Project Creator : disruptorbeam

internal void OnGUI()
        {
            if (!m_Enabled)
            {
                Enable();
            }

            if (BuildPipeline.isBuildingPlayer)
            {
                m_IsBuilding = true;
            }
            else if (m_IsBuilding)
            {
                m_IsBuilding = false;
                Repaint();
            }

            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            var selectedIndex = m_TestTypeToolbarIndex;
            m_TestTypeToolbarIndex = GUILayout.Toolbar(m_TestTypeToolbarIndex, Enum.GetNames(typeof(TestRunnerMenuLabels)), "LargeButton", UnityEngine.GUI.ToolbarButtonSize.FitToContents);
            GUILayout.FlexibleSpace();
            EditorGUILayout.EndHorizontal();

            if (selectedIndex != m_TestTypeToolbarIndex)
            {
                SelectTestListGUI(m_TestTypeToolbarIndex);
                StartRetrieveTestList();
            }

            EditorGUILayout.BeginVertical();
            using (new EditorGUI.DisabledScope(EditorApplication.isPlayingOrWillChangePlaymode))
            {
                m_SelectedTestTypes.PrintHeadPanel();
            }
            EditorGUILayout.EndVertical();

            if (m_Settings.verticalSplit)
                SplitterGUILayout.BeginVerticalSplit(m_Spl);
            else
                SplitterGUILayout.BeginHorizontalSplit(m_Spl);

            EditorGUILayout.BeginVertical();
            EditorGUILayout.BeginVertical(Styles.testList);
            m_SelectedTestTypes.RenderTestList();
            EditorGUILayout.EndVertical();
            EditorGUILayout.EndVertical();

            m_SelectedTestTypes.RenderDetails();

            if (m_Settings.verticalSplit)
                SplitterGUILayout.EndVerticalSplit();
            else
                SplitterGUILayout.EndHorizontalSplit();
        }

19 View Source File : DisplayInfo.cs
License : MIT License
Project Creator : DreamersIncStudios

void DisplayAIStates() {
            EditorGUILayout.BeginVertical("Box", GUILayout.Width(500));
            GUILayout.Label("Character Stats Info", EditorStyles.boldLabel);
            AiStateInt = GUILayout.Toolbar(AiStateInt, AIStatesTab);
            switch (AiStateInt) {
                case 0:
                    GetPatrol = SetupPatrol(GetPatrol);
                    break;
                case 1:
                    GetWait = SetupWait(GetWait);
                    break;
                case 2:
                    GetAttacks = SetupAttacks();
                    break;
                case 3:
                    GetRetreat = SetupRetreat(GetRetreat);
                    break;
            //    case 0:
            //        break;
            //    case 0:
            //        break;
            }

            EditorGUILayout.EndVertical();
        }

19 View Source File : NPCEditor.cs
License : MIT License
Project Creator : DreamersIncStudios

void OnGUI()
        {
            menuInt = GUILayout.Toolbar(menuInt, menuOptions);

            EditorGUILayout.BeginHorizontal();
            DisplayListOfExistingSO();
            switch (menuInt) {
                case 0:
                    DisplayBasicInfo();
                    break;
                case 1:
                    DisplayStatInfo();
                    break;
                case 2:
                    DisplayDetectionInfo();
                    break;
                case 3:
                    DisplayAIStates();
                    break;
            
            }
            //GetTeam = SetupEnemy();



            EditorGUILayout.EndVertical();

            // add a switch here
            EditorGUILayout.BeginHorizontal("Box");
            switch (editorState)
            {
                case EditorState.CreateNew:

                    if (GUILayout.Button("Submit"))
                    {
                        CreateSO("replacedets/Resources/NPC");
                        Repaint();

                    }
                    break;
                case EditorState.EditExisting:

                    if (GUILayout.Button("Update"))
                    {
                        SaveChangesToNPCSO();
                        Repaint();


                    }
                    if (GUILayout.Button("Create New SO"))
                    {
                        CreateSO("replacedets/Resources/NPC SO AI");
                        Repaint();

                    }
                    break;
            }
            if (GUILayout.Button("Clear"))
            {
                // add nodal window to verfiy 
                SetStartValues();
                Repaint();
            }
            EditorGUILayout.EndHorizontal();

        }

19 View Source File : LUTEditor.cs
License : MIT License
Project Creator : IllusionMods

private void OnGUI()
        {
            _scrollPosition = GUILayout.BeginScrollView(_scrollPosition);

            Settings.SelectedTab = EditorPrefs.GetInt("AmplifyColor.SelectedTab", 3);

            Settings.SelectedTab = GUILayout.Toolbar(Settings.SelectedTab, new[] { "Photoshop", "File", "Settings" });

            EditorPrefs.SetInt("AmplifyColor.SelectedTab", Settings.SelectedTab);

            switch (Settings.SelectedTab)
            {
                case 0:
                    ShowReadBackBufferGUI();
                    ShowGUIPhotoshop();
                    ShowGUITargetFile();
                    ShowGUIStatusBar();
                    ShowLUTChecklist();
                    break;
                case 1:
                    ShowReadBackBufferGUI();
                    ShowGUIFile();
                    ShowGUITargetFile();
                    ShowGUIStatusBar();
                    break;
                case 2:
                    ShowGUISettings();
                    ShowGUIStatusBar();
                    ShowConnectionChecklist();
                    break;
            }

            GUILayout.EndScrollView();
        }

19 View Source File : AssetBundleAnalyzer.cs
License : Apache License 2.0
Project Creator : mutouzdl

private void OnGUI()
        {
            EditorGUILayout.BeginVertical(GUILayout.Width(position.width), GUILayout.Height(position.height));
            {
                GUILayout.Space(5f);
                int toolbarIndex = GUILayout.Toolbar(m_ToolbarIndex, new string[] { "Summary", "replacedet Dependency Viewer", "Scattered replacedet Viewer", "Circular Dependency Viewer" }, GUILayout.Height(30f));
                if (toolbarIndex != m_ToolbarIndex)
                {
                    m_ToolbarIndex = toolbarIndex;
                    GUI.FocusControl(null);
                }

                switch (m_ToolbarIndex)
                {
                    case 0:
                        DrawSummary();
                        break;
                    case 1:
                        DrawreplacedetDependencyViewer();
                        break;
                    case 2:
                        DrawScatteredreplacedetViewer();
                        break;
                    case 3:
                        DrawCircularDependencyViewer();
                        break;
                }
            }
            EditorGUILayout.EndVertical();
        }

19 View Source File : DebuggerComponent.cs
License : Apache License 2.0
Project Creator : mutouzdl

private void DrawDebuggerWindowGroup(IDebuggerWindowGroup debuggerWindowGroup)
        {
            if (debuggerWindowGroup == null)
            {
                return;
            }

            List<string> names = new List<string>();
            string[] debuggerWindowNames = debuggerWindowGroup.GetDebuggerWindowNames();
            for (int i = 0; i < debuggerWindowNames.Length; i++)
            {
                names.Add(string.Format("<b>{0}</b>", debuggerWindowNames[i]));
            }

            if (debuggerWindowGroup == m_DebuggerManager.DebuggerWindowRoot)
            {
                names.Add("<b>Close</b>");
            }

            int toolbarIndex = GUILayout.Toolbar(debuggerWindowGroup.SelectedIndex, names.ToArray(), GUILayout.Height(30f), GUILayout.MaxWidth(Screen.width));
            if (toolbarIndex >= debuggerWindowGroup.DebuggerWindowCount)
            {
                m_ShowFullWindow = false;
                return;
            }

            if (debuggerWindowGroup.SelectedIndex != toolbarIndex)
            {
                debuggerWindowGroup.SelectedWindow.OnLeave();
                debuggerWindowGroup.SelectedIndex = toolbarIndex;
                debuggerWindowGroup.SelectedWindow.OnEnter();
            }

            IDebuggerWindowGroup subDebuggerWindowGroup = debuggerWindowGroup.SelectedWindow as IDebuggerWindowGroup;
            if (subDebuggerWindowGroup != null)
            {
                DrawDebuggerWindowGroup(subDebuggerWindowGroup);
            }

            if (debuggerWindowGroup.SelectedWindow != null)
            {
                debuggerWindowGroup.SelectedWindow.OnDraw();
            }
        }

19 View Source File : EditorUtils GUILayout.cs
License : MIT License
Project Creator : naivetang

public int Toolbar(int selected, GUIContent[] content, params GUILayoutOption[] options)
        {
            return GUILayout.Toolbar(selected, content, options);
        }

19 View Source File : EditorUtils GUILayout.cs
License : MIT License
Project Creator : naivetang

public int Toolbar(int selected, GUIContent[] contents, GUIStyle style, params GUILayoutOption[] options)
        {
            return GUILayout.Toolbar(selected, contents, style, options);
        }

19 View Source File : ScannerEditor.cs
License : MIT License
Project Creator : naivetang

public override void OnInspectorGUI()
        {
            m_scanner = (Scanner)target;

            //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.fontStyle = FontStyle.Normal;
                m_wrapStyle.wordWrap = true;
            }

            //Text intro
            GUILayout.BeginVertical("Gaia Scanner", m_boxStyle);
            GUILayout.Space(20);
            EditorGUILayout.LabelField("The Gaia Scanner allows you to create new stamps from Windows R16, Windows 16 bit RAW, Mac 16 bit RAW, Terrains, Textures or Meshes. Just drag and drop the file or object onto the area below to scan it.", m_wrapStyle);
            GUILayout.EndVertical();

            DropAreaGUI();

			//Drop Options section
            GUILayout.BeginHorizontal();
			{
				EditorGUILayout.PrefixLabel(BYTE_ORDER_LABEL);
				EditorGUI.BeginChangeCheck();
				{
					m_rawByteOrder = (Gaia.GaiaConstants.RawByteOrder)GUILayout.Toolbar((int)m_rawByteOrder, new string[] { "IBM PC", "Macintosh" });
				}
				if (EditorGUI.EndChangeCheck())
				{
					ReloadRawFile();
				}
			}
			GUILayout.EndHorizontal();
			EditorGUI.BeginChangeCheck();
			{
				m_rawBitDepth = (GaiaConstants.RawBitDepth)EditorGUILayout.Popup(BIT_DEPTH_LABEL, (int)m_rawBitDepth, BIT_DEPTHS_LABELS);
			}
			if (EditorGUI.EndChangeCheck())
			{
				ReloadRawFile();
			}
            GUILayout.BeginVertical();
			if (m_showRawInfo)
			{
				EditorGUILayout.HelpBox("replacedumed " + (m_rawBitDepth == GaiaConstants.RawBitDepth.Sixteen ? "16-bit" : "8-bit") + " RAW " + m_replacedumedRawRes + " x " + m_replacedumedRawRes, MessageType.Info);
			}
			if (m_showBitDepthWarning)
			{
				EditorGUILayout.HelpBox("WARNING: 8-bit RAW files have very poor precision and result in terraced stamps.", MessageType.Warning);
			}
			GUILayout.EndVertical();

			DrawDefaultInspector();

            //Terraform section
            GUILayout.BeginVertical("Scanner Controller", m_boxStyle);
            GUILayout.Space(20);
            GUILayout.BeginHorizontal();

            if (GUILayout.Button("Save Scan"))
            {
                m_scanner.SaveScan();
                replacedetDatabase.Refresh();
            }

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

			m_showRawInfo = m_replacedumedRawRes > 0;
			m_showBitDepthWarning = m_rawBitDepth == GaiaConstants.RawBitDepth.Eight;
	}

19 View Source File : GUIUtility.cs
License : GNU General Public License v3.0
Project Creator : ore-

internal static TEnum Toolbar<TEnum>(TEnum selected)
        {
            GUILayout.BeginHorizontal();
            string[] selection = Enum.GetNames(typeof(TEnum));
            string[] localizedSelection = LocalizationManager.HasLocalization() ? selection.Select(text => LocalizationManager.Localized(text)).ToArray() : selection;
            int currentIndex = Array.IndexOf(selection, selected.ToString());
            int selectedIndex = GUILayout.Toolbar(currentIndex, localizedSelection, GUIStyles.toolbarbutton);
            GUILayout.EndHorizontal();
            if (selectedIndex == currentIndex)
            {
                return selected;
            }

            string selectedName = selection.GetValue(selectedIndex).ToString();
            selected = (TEnum)Enum.Parse(typeof(TEnum), selectedName);
            return selected;
        }

19 View Source File : AppRequests.cs
License : MIT License
Project Creator : PacktPublishing

protected override void GetGui()
        {
            if (this.Button("Select - Filter None"))
            {
                FB.AppRequest("Test Message", callback: this.HandleResult);
            }

            if (this.Button("Select - Filter app_users"))
            {
                List<object> filter = new List<object>() { "app_users" };

                // workaround for mono failing with named parameters
                FB.AppRequest("Test Message", null, filter, null, 0, string.Empty, string.Empty, this.HandleResult);
            }

            if (this.Button("Select - Filter app_non_users"))
            {
                List<object> filter = new List<object>() { "app_non_users" };
                FB.AppRequest("Test Message", null, filter, null, 0, string.Empty, string.Empty, this.HandleResult);
            }

            // Custom options
            this.LabelAndTextField("Message: ", ref this.requestMessage);
            this.LabelAndTextField("To (optional): ", ref this.requestTo);
            this.LabelAndTextField("Filter (optional): ", ref this.requestFilter);
            this.LabelAndTextField("Exclude Ids (optional): ", ref this.requestExcludes);
            this.LabelAndTextField("Filters: ", ref this.requestExcludes);
            this.LabelAndTextField("Max Recipients (optional): ", ref this.requestMax);
            this.LabelAndTextField("Data (optional): ", ref this.requestData);
            this.LabelAndTextField("replacedle (optional): ", ref this.requestreplacedle);

            GUILayout.BeginHorizontal();
            GUILayout.Label(
                "Request Action (optional): ",
                this.LabelStyle,
                GUILayout.MaxWidth(200 * this.ScaleFactor));

            this.selectedAction = GUILayout.Toolbar(
                this.selectedAction,
                this.actionTypeStrings,
                this.ButtonStyle,
                GUILayout.MinHeight(ConsoleBase.ButtonHeight * this.ScaleFactor),
                GUILayout.MaxWidth(ConsoleBase.MainWindowWidth - 150));

            GUILayout.EndHorizontal();
            this.LabelAndTextField("Request Object ID (optional): ", ref this.requestObjectID);

            if (this.Button("Custom App Request"))
            {
                OGActionType? action = this.GetSelectedOGActionType();
                if (action != null)
                {
                    FB.AppRequest(
                        this.requestMessage,
                        action.Value,
                        this.requestObjectID,
                        string.IsNullOrEmpty(this.requestTo) ? null : this.requestTo.Split(','),
                        this.requestData,
                        this.requestreplacedle,
                        this.HandleResult);
                }
                else
                {
                    FB.AppRequest(
                        this.requestMessage,
                        string.IsNullOrEmpty(this.requestTo) ? null : this.requestTo.Split(','),
                        string.IsNullOrEmpty(this.requestFilter) ? null : this.requestFilter.Split(',').OfType<object>().ToList(),
                        string.IsNullOrEmpty(this.requestExcludes) ? null : this.requestExcludes.Split(','),
                        string.IsNullOrEmpty(this.requestMax) ? 0 : int.Parse(this.requestMax),
                        this.requestData,
                        this.requestreplacedle,
                        this.HandleResult);
                }
            }
        }

19 View Source File : UI.cs
License : MIT License
Project Creator : phorcys

private void DrawTab(int tabId, ref UnityAction buttons)
            {
                var minWidth = GUILayout.MinWidth(mWindowWidth);

                switch (tabs[tabId])
                {
                    case "Mods":
                        {
                            mScrollPosition[tabId] = GUILayout.BeginScrollView(mScrollPosition[tabId], minWidth, GUILayout.ExpandHeight(false));

                            var amountWidth = mColumns.Where(x => !x.skip).Sum(x => x.width);
                            var expandWidth = mColumns.Where(x => x.expand && !x.skip).Sum(x => x.width);

                            var mods = modEntries;
                            var colWidth = mColumns.Select(x =>
                                x.expand
                                    ? GUILayout.Width(x.width / expandWidth * (mWindowWidth - 60 + expandWidth - amountWidth))
                                    : GUILayout.Width(x.width)).ToArray();

                            GUILayout.BeginVertical("box");

                            GUILayout.BeginHorizontal("box");
                            for (int i = 0; i < mColumns.Count; i++)
                            {
                                if (mColumns[i].skip)
                                    continue;
                                GUILayout.Label(mColumns[i].name, colWidth[i]);
                            }

                            GUILayout.EndHorizontal();

                            for (int i = 0, c = mods.Count; i < c; i++)
                            {
                                int col = -1;
                                GUILayout.BeginVertical("box");
                                GUILayout.BeginHorizontal();

                                GUILayout.BeginHorizontal(colWidth[++col]);
                                if (mods[i].OnGUI != null)
                                {
                                    if (GUILayout.Button(mods[i].Info.DisplayName, GUI.skin.label, GUILayout.ExpandWidth(true)))
                                    {
                                        mShowModSettings = (mShowModSettings == i) ? -1 : i;
                                    }

                                    if (GUILayout.Button(mShowModSettings == i ? Textures.SettingsActive : Textures.SettingsNormal, settings))
                                    {
                                        mShowModSettings = (mShowModSettings == i) ? -1 : i;
                                    }
                                }
                                else
                                {
                                    GUILayout.Label(mods[i].Info.DisplayName);
                                }

                                if (!string.IsNullOrEmpty(mods[i].Info.HomePage))
                                {
                                    GUILayout.Space(10);
                                    if (GUILayout.Button(Textures.WWW, www))
                                    {
                                        Application.OpenURL(mods[i].Info.HomePage);
                                    }
                                }

                                if (mods[i].NewestVersion != null)
                                {
                                    GUILayout.Space(10);
                                    GUILayout.Box(Textures.Updates, updates);
                                }

                                GUILayout.Space(20);

                                GUILayout.EndHorizontal();

                                GUILayout.BeginHorizontal(colWidth[++col]);
                                GUILayout.Label(mods[i].Info.Version, GUILayout.ExpandWidth(false));
                                //                            if (string.IsNullOrEmpty(mods[i].Info.Repository))
                                //                            {
                                //                                GUI.color = new Color32(255, 81, 83, 255);
                                //                                GUILayout.Label("*");
                                //                                GUI.color = Color.white;
                                //                            }
                                GUILayout.EndHorizontal();

                                if (mods[i].ManagerVersion > GetVersion())
                                {
                                    GUI.color = new Color32(255, 81, 83, 255);
                                    GUILayout.Label("Manager-" + mods[i].Info.ManagerVersion, colWidth[++col]);
                                    GUI.color = Color.white;
                                }
                                else if (mods[i].Requirements.Count > 0)
                                {
                                    GUILayout.Label(string.Join("\r\n", mods[i].Info.Requirements), colWidth[++col]);
                                }
                                else
                                {
                                    GUILayout.Label("-", colWidth[++col]);
                                }

                                var action = mods[i].Enabled;
                                action = GUILayout.Toggle(action, "", colWidth[++col]);
                                if (action != mods[i].Enabled)
                                {
                                    mods[i].Enabled = action;
                                    if (mods[i].Toggleable)
                                        mods[i].Active = action;
                                }

                                if (mods[i].Active)
                                {
                                    GUILayout.Box(mods[i].Enabled ? Textures.StatusActive : Textures.StatusNeedRestart, status);
                                }
                                else
                                {
                                    GUILayout.Box(!mods[i].Enabled ? Textures.StatusInactive : Textures.StatusNeedRestart, status);
                                }

                                GUILayout.EndHorizontal();

                                if (mShowModSettings == i)
                                {
                                    GUILayout.Label("Options", h2);
                                    try
                                    {
                                        mods[i].OnGUI(mods[i]);
                                    }
                                    catch (Exception e)
                                    {
                                        mShowModSettings = -1;
                                        mods[i].Logger.Error("OnGUI error.");
                                        Debug.LogException(e);
                                    }
                                }

                                GUILayout.EndVertical();
                            }

                            GUILayout.EndVertical();

                            GUILayout.EndScrollView();

                            GUILayout.Space(10);

                            GUILayout.BeginHorizontal();
                            GUILayout.Space(10);
                            GUILayout.Box(Textures.SettingsNormal, settings);
                            GUILayout.Space(3);
                            GUILayout.Label("Options", GUILayout.ExpandWidth(false));
                            GUILayout.Space(15);
                            GUILayout.Box(Textures.WWW, www);
                            GUILayout.Space(3);
                            GUILayout.Label("Home page", GUILayout.ExpandWidth(false));
                            GUILayout.Space(15);
                            GUILayout.Box(Textures.Updates, updates);
                            GUILayout.Space(3);
                            GUILayout.Label("Available update", GUILayout.ExpandWidth(false));
                            GUILayout.Space(15);
                            GUILayout.Box(Textures.StatusActive, status);
                            GUILayout.Space(3);
                            GUILayout.Label("Active", GUILayout.ExpandWidth(false));
                            GUILayout.Space(10);
                            GUILayout.Box(Textures.StatusInactive, status);
                            GUILayout.Space(3);
                            GUILayout.Label("Inactive", GUILayout.ExpandWidth(false));
                            GUILayout.Space(10);
                            GUILayout.Box(Textures.StatusNeedRestart, status);
                            GUILayout.Space(3);
                            GUILayout.Label("Need restart", GUILayout.ExpandWidth(false));
                            GUILayout.Space(10);
                            GUILayout.Label("[CTRL + LClick]", bold, GUILayout.ExpandWidth(false));
                            GUILayout.Space(3);
                            GUILayout.Label("Drag window", GUILayout.ExpandWidth(false));
                            //                        GUILayout.Space(10);
                            //                        GUI.color = new Color32(255, 81, 83, 255);
                            //                        GUILayout.Label("*", bold, GUILayout.ExpandWidth(false));
                            //                        GUI.color = Color.white;
                            //                        GUILayout.Space(3);
                            //                        GUILayout.Label("Not support updates", GUILayout.ExpandWidth(false));
                            GUILayout.EndHorizontal();

                            if (GUI.changed)
                            {
                            }

                            break;
                        }

                    case "Logs":
                        {
                            if (mLogTimer > 1)
                            {
                                mLogTimer = 0;
                                var filepath = Logger.filepath;
                                if (File.Exists(filepath))
                                {
                                    var fileinfo = new FileInfo(filepath);
                                    if (mFilelogLength != fileinfo.Length)
                                    {
                                        mFilelogLength = fileinfo.Length;
                                        mLogStrings = File.ReadAllLines(filepath);
                                    }
                                }
                            }

                            mScrollPosition[tabId] = GUILayout.BeginScrollView(mScrollPosition[tabId], minWidth);

                            GUILayout.BeginVertical("box");
                            for (int i = Mathf.Max(0, mLogStrings.Length - 200); i < mLogStrings.Length; i++)
                            {
                                GUILayout.Label(mLogStrings[i]);
                            }

                            GUILayout.EndVertical();
                            GUILayout.EndScrollView();

                            buttons += delegate
                            {
                                if (GUILayout.Button("Clear", GUILayout.Width(150)))
                                {
                                    Logger.Clear();
                                }
                            };

                            if (GUI.changed)
                            {
                            }

                            break;
                        }

                    case "Settings":
                        {
                            mScrollPosition[tabId] = GUILayout.BeginScrollView(mScrollPosition[tabId], minWidth);

                            GUILayout.BeginVertical("box");

                            GUILayout.BeginHorizontal();
                            GUILayout.Label("Shortcut Key", GUILayout.ExpandWidth(false));
                            Params.ShortcutKeyId =
                                GUILayout.Toolbar(Params.ShortcutKeyId, mShortcutNames, GUILayout.ExpandWidth(false));
                            GUILayout.EndHorizontal();

                            GUILayout.Space(5);

                            GUILayout.BeginHorizontal();
                            GUILayout.Label("Check updates", GUILayout.ExpandWidth(false));
                            Params.CheckUpdates = GUILayout.Toolbar(Params.CheckUpdates, mCheckUpdateStrings,
                                GUILayout.ExpandWidth(false));
                            GUILayout.EndHorizontal();

                            GUILayout.EndVertical();
                            GUILayout.EndScrollView();

                            if (GUI.changed)
                            {
                            }

                            break;
                        }
                }
            }

19 View Source File : VoxelRendererEditor.cs
License : Apache License 2.0
Project Creator : QinZhuo

public override void OnInspectorGUI(){
       
       
       
		selectId  = GUILayout.Toolbar(selectId, selectNames);
	
		if(selectId==1){
			renderer.GridSize=EditorGUILayout.FloatField("体素渲染大小",renderer.GridSize);
			renderer.boneRoot=EditorGUILayout.ObjectField("指定根骨骼",renderer.boneRoot,typeof(Transform))as Transform;
			if(GUILayout.Button("加载.vox文件")){
				LoadVoxFileWindows();
			}
			if(GUILayout.Button("加载.voxData文件")){
				LoadVoxelData();
				renderer.InitRender();
				Debug.LogError("加载完成");
			}
			if(renderer.boneRoot!=null){
				renderer.minBoneLen=EditorGUILayout.FloatField("骨骼检索最小长度",renderer.minBoneLen);
				if(GUILayout.Button("获取骨骼")){
					renderer.GetBones();
				}
				if(GUILayout.Button("绑定骨骼")){
					renderer.Bind();
				}
			
				if(GUILayout.Button(renderer.ShowVoxelWeight?"关闭权重显示":"打开权重显示")){
					renderer.ShowVoxelWeight=!renderer.ShowVoxelWeight;
				}
				if(GUILayout.Button("旋转渲染器")){
					renderer.renderRoot.Rotate(new Vector3(0,90,0));
				}
			}
		}else
		{	
			if(renderer.ShowVoxelWeight){
				renderer.ShowVoxelWeight=false;
			}
			GUILayout.Label("体素渲染大小 : "+(renderer.GridSize));
			GUILayout.Label("体素数目 : "+(voxelData.voxels.Count));
			GUILayout.Label("是否绑骨 : "+(renderer.boneRoot!=null));
			
		}
        
    }

19 View Source File : GUIUtil.cs
License : MIT License
Project Creator : seldomU

public static Enum EnumToolbar( string prefixLabel, Enum selected, Func<Enum, GUIContent> getContent, GUIStyle style, params GUILayoutOption[] options )
		{
			var values = Enum.GetValues( selected.GetType() );
			var contents = values.OfType<Enum>().Select( val => getContent( val ) ).ToArray();

			int selected_index = 0;
			while ( selected_index < values.Length )
			{
				if ( selected.ToString() == values.GetValue( selected_index ).ToString() )
					break;
				selected_index++;
			}

			GUILayout.BeginHorizontal();
			if ( !string.IsNullOrEmpty( prefixLabel ) )
			{
				GUILayout.Label( prefixLabel );
				GUILayout.Space( 10 );
			}

			selected_index = GUILayout.Toolbar( selected_index, contents, style, options );
			GUILayout.FlexibleSpace();
			GUILayout.EndHorizontal();

			return (Enum) values.GetValue( selected_index );
		}

19 View Source File : PortraitEditor.cs
License : GNU General Public License v3.0
Project Creator : thiagosoara

public override void DrawCommandGUI() 
        {
            serializedObject.Update();
            
            Portrait t = target as Portrait;

            if (Stage.ActiveStages.Count > 1)
            {
                CommandEditor.ObjectField<Stage>(stageProp, 
                                                         new GUIContent("Portrait Stage", "Stage to display the character portraits on"), 
                                                         new GUIContent("<Default>"),
                                                         Stage.ActiveStages);
            }
            else
            {
                t._Stage = null;
            }
            // Format Enum names
            string[] displayLabels = StringFormatter.FormatEnumNames(t.Display,"<None>");
            displayProp.enumValueIndex = EditorGUILayout.Popup("Display", (int)displayProp.enumValueIndex, displayLabels);

            string characterLabel = "Character";
            if (t.Display == DisplayType.Replace)
            {
                CommandEditor.ObjectField<Character>(replacedCharacterProp, 
                                                     new GUIContent("Replace", "Character to replace"), 
                                                     new GUIContent("<None>"),
                                                     Character.ActiveCharacters);
                characterLabel = "With";
            }
            
            CommandEditor.ObjectField<Character>(characterProp, 
                                                 new GUIContent(characterLabel, "Character to display"), 
                                                 new GUIContent("<None>"),
                                                 Character.ActiveCharacters);

            bool showOptionalFields = true;
            Stage s = t._Stage;
            // Only show optional portrait fields once required fields have been filled...
            if (t._Character != null)                // Character is selected
            {
                if (t._Character.Portraits == null ||    // Character has a portraits field
                    t._Character.Portraits.Count <= 0 )   // Character has at least one portrait
                {
                    EditorGUILayout.HelpBox("This character has no portraits. Please add portraits to the character's prefab before using this command.", MessageType.Error);
                    showOptionalFields = false; 
                }
                if (t._Stage == null)            // If default portrait stage selected
                {
                    if (t._Stage == null)        // If no default specified, try to get any portrait stage in the scene
                    {
                        s = GameObject.FindObjectOfType<Stage>();
                    }
                }
                if (s == null)
                {
                    EditorGUILayout.HelpBox("No portrait stage has been set.", MessageType.Error);
                    showOptionalFields = false; 
                }
            }
            if (t.Display != DisplayType.None && t._Character != null && showOptionalFields) 
            {
                if (t.Display != DisplayType.Hide && t.Display != DisplayType.MoveToFront) 
                {
                    // PORTRAIT
                    CommandEditor.ObjectField<Sprite>(portraitProp, 
                                                      new GUIContent("Portrait", "Portrait representing character"), 
                                                      new GUIContent("<Previous>"),
                                                      t._Character.Portraits);
                    if (t._Character.PortraitsFace != FacingDirection.None)
                    {
                        // FACING
                        // Display the values of the facing enum as <-- and --> arrows to avoid confusion with position field
                        string[] facingArrows = new string[]
                        {
                            "<Previous>",
                            "<--",
                            "-->",
                        };
                        facingProp.enumValueIndex = EditorGUILayout.Popup("Facing", (int)facingProp.enumValueIndex, facingArrows);
                    }
                    else
                    {
                        t.Facing = FacingDirection.None;
                    }
                }
                else
                {
                    t._Portrait = null;
                    t.Facing = FacingDirection.None;
                }
                string toPositionPrefix = "";
                if (t.Move)
                {
                    // MOVE
                    EditorGUILayout.PropertyField(moveProp);
                }
                if (t.Move)
                {
                    if (t.Display != DisplayType.Hide) 
                    {
                        // START FROM OFFSET
                        EditorGUILayout.PropertyField(shiftIntoPlaceProp);
                    }
                }
                if (t.Move)
                {
                    if (t.Display != DisplayType.Hide) 
                    {
                        if (t.ShiftIntoPlace)
                        {
                            t.FromPosition = null;
                            // OFFSET
                            // Format Enum names
                            string[] offsetLabels = StringFormatter.FormatEnumNames(t.Offset,"<Previous>");
                            offsetProp.enumValueIndex = EditorGUILayout.Popup("From Offset", (int)offsetProp.enumValueIndex, offsetLabels);
                        }
                        else
                        {
                            t.Offset = PositionOffset.None;
                            // FROM POSITION
                            CommandEditor.ObjectField<RectTransform>(fromPositionProp, 
                                                                     new GUIContent("From Position", "Move the portrait to this position"), 
                                                                     new GUIContent("<Previous>"),
                                                                     s.Positions);
                        }
                    }
                    toPositionPrefix = "To ";
                }
                else
                {
                    t.ShiftIntoPlace = false;
                    t.FromPosition = null;
                    toPositionPrefix = "At ";
                }
                if (t.Display == DisplayType.Show || (t.Display == DisplayType.Hide && t.Move) )
                {
                    // TO POSITION
                    CommandEditor.ObjectField<RectTransform>(toPositionProp, 
                                                             new GUIContent(toPositionPrefix+"Position", "Move the portrait to this position"), 
                                                             new GUIContent("<Previous>"),
                                                             s.Positions);
                }
                else
                {
                    t.ToPosition = null;
                }
                if (!t.Move && t.Display != DisplayType.MoveToFront)
                {
                    // MOVE
                    EditorGUILayout.PropertyField(moveProp);
                }
                if (t.Display != DisplayType.MoveToFront)
                {
                
                    EditorGUILayout.Separator();

                    // USE DEFAULT SETTINGS
                    EditorGUILayout.PropertyField(useDefaultSettingsProp);
                    if (!t.UseDefaultSettings) {
                        // FADE DURATION
                        EditorGUILayout.PropertyField(fadeDurationProp);
                        if (t.Move)
                        {
                            // MOVE SPEED
                            EditorGUILayout.PropertyField(moveDurationProp);
                        }
                        if (t.ShiftIntoPlace)
                        {
                            // SHIFT OFFSET
                            EditorGUILayout.PropertyField(shiftOffsetProp);
                        }
                    }
                }
                else
                {
                    t.Move = false;
                    t.UseDefaultSettings = true;
                    EditorGUILayout.Separator();
                }

                EditorGUILayout.PropertyField(waitUntilFinishedProp);


                if (t._Portrait != null && t.Display != DisplayType.Hide)
                {
                    Texture2D characterTexture = t._Portrait.texture;

                    float aspect = (float)characterTexture.width / (float)characterTexture.height;
                    Rect previewRect = GUILayoutUtility.GetAspectRect(aspect, GUILayout.Width(100), GUILayout.ExpandWidth(true));

                    if (characterTexture != null)
                    {
                        GUI.DrawTexture(previewRect,characterTexture,ScaleMode.ScaleToFit,true,aspect);
                    }
                }

                if (t.Display != DisplayType.Hide)
                {
                    string portraitName = "<Previous>";
                    if (t._Portrait != null)
                    {
                        portraitName = t._Portrait.name;
                    }
                    string portraitSummary = " " + portraitName;
                    int toolbarInt = 1;
                    string[] toolbarStrings = {"<--",  portraitSummary, "-->"};
                    toolbarInt = GUILayout.Toolbar (toolbarInt, toolbarStrings, GUILayout.MinHeight(20));
                    int portraitIndex = -1;

                    if (toolbarInt != 1)
                    {
                        for(int i=0; i<t._Character.Portraits.Count; i++){
                            if(portraitName == t._Character.Portraits[i].name) 
                            {
                                portraitIndex = i;
                            }
                        }
                    }

                    if (toolbarInt == 0)
                    {
                        if(portraitIndex > 0)
                        {
                            t._Portrait = t._Character.Portraits[--portraitIndex];
                        }
                        else
                        {
                            t._Portrait = null;
                        }
                    }
                    if (toolbarInt == 2)
                    {
                        if(portraitIndex < t._Character.Portraits.Count-1)
                        {
                            t._Portrait = t._Character.Portraits[++portraitIndex];
                        }
                    }
                }
            }
            serializedObject.ApplyModifiedProperties();
        }

19 View Source File : SmootherControl.cs
License : MIT License
Project Creator : Unity-Technologies

public static void SmootherControl (int toggler, float value, 
            string label, string tooltip,  ChangeHandler change,
            int endIndex = -1)
        {
            if (s_SmootherOptionsContent == null)
            {
                var unionIcon = lightSkinUnionIcon;
                var smoothIcon = lightSkinNumberIcon;
                var noneIcon = lightSkinNoneIcon;
                if (EditorGUIUtility.isProSkin)
                {
                    unionIcon = darkSkinUnionIcon;
                    smoothIcon = darkSkinNumberIcon;
                    noneIcon = darkSkinNoneIcon;
                }

                s_SmootherOptionsContent = new GUIContent[] {
                    new GUIContent(smoothIcon, "Smooth to value"),
                    new GUIContent(noneIcon, "No smoothing"),
                    new GUIContent(unionIcon, "Unify all")
                };
            }

            using (new EditorGUILayout.VerticalScope())
            {
                var options = endIndex == -1 ? s_SmootherOptionsContent : 
                    s_SmootherOptionsContent.Take(endIndex).ToArray();

                EditorGUI.BeginChangeCheck();
                int oldToggle = toggler;
                toggler = GUILayout.Toolbar(toggler, options, GUILayout.MaxWidth(100));

                float lw = EditorGUIUtility.labelWidth;
                EditorGUIUtility.labelWidth = 50;
                float fw = EditorGUIUtility.fieldWidth;
                EditorGUIUtility.fieldWidth = 20;
                EditorGUI.BeginDisabledGroup(toggler != HeatmapDataProcessor.SMOOTH_VALUE);
                value = EditorGUILayout.FloatField(new GUIContent(label, tooltip), value);
                value = Mathf.Max(0, value);
                EditorGUI.EndDisabledGroup();
                EditorGUIUtility.labelWidth = lw;
                EditorGUIUtility.fieldWidth = fw;

                if (EditorGUI.EndChangeCheck() || oldToggle != toggler)
                {
                    change(toggler, value);
                }
            }
        }

19 View Source File : NoiseBall.cs
License : MIT License
Project Creator : Unity-Technologies

public void OnGUI()
    {
        if (m_UIOptions == null)
        {
            m_UIOptions = new[]
            {
                new GUIContent("C# 1 thread"),
                new GUIContent("Burst 1 thread"),
                new GUIContent("Burst threaded"),
#if UNITY_2021_2_OR_NEWER // Mesh GPU buffer access is since 2021.2            
                new GUIContent("GPU compute"),
#endif
            };
        }
        GUI.matrix = Matrix4x4.Scale(Vector3.one * 2);
        GUILayout.BeginArea(new Rect(5,25,420,80), "Options", GUI.skin.window);
        m_Mode = (Mode)GUILayout.Toolbar((int)m_Mode, m_UIOptions);
        GUILayout.BeginHorizontal();
        GUILayout.Label($"Triangles: {m_TriangleCount/1000}K", GUILayout.Width(120));

        int triIndex = TrisToIndex(m_TriangleCount);
        int newTriIndex = Mathf.RoundToInt(GUILayout.HorizontalSlider(triIndex, 1, 10));
        if (triIndex != newTriIndex)
            m_TriangleCount = IndexToTris(newTriIndex);
        GUILayout.EndHorizontal();
        GUILayout.EndArea();
    }

19 View Source File : ProceduralWaterMesh.cs
License : MIT License
Project Creator : Unity-Technologies

public void OnGUI()
	{
		if (m_UIOptions == null)
		{
			m_UIOptions = new[]
			{
				new GUIContent("C# 1 thread"),
				new GUIContent("Burst 1 thread"),
				new GUIContent("Burst threaded"),
#if UNITY_2021_2_OR_NEWER // Mesh GPU buffer access is since 2021.2
                new GUIContent("GPU compute"),
#endif
			};
		}
		GUI.matrix = Matrix4x4.Scale(Vector3.one * 2);
		GUILayout.BeginArea(new Rect(5,25,420,80), "Options", GUI.skin.window);
		mode = (Mode)GUILayout.Toolbar((int)mode, m_UIOptions);
		GUILayout.Label($"Water: {surfaceWidthPoints}x{surfaceLengthPoints}, {m_WaveSources.Length} wave sources");
		GUILayout.EndArea();
	}

19 View Source File : UsdAssetEditor.cs
License : Apache License 2.0
Project Creator : Unity-Technologies

public override void OnInspectorGUI()
        {
            var usdreplacedet = (Usdreplacedet)this.target;

            if (usdreplacedet.m_displayColorMaterial == null)
            {
                Debug.LogWarning("No fallback material set, reverting to default");
                var matMap = new MaterialMap();
                usdreplacedet.m_displayColorMaterial = matMap.DisplayColorMaterial;
            }

            if (usdreplacedet.m_metallicWorkflowMaterial == null)
            {
                Debug.LogWarning("No metallic material set, reverting to default");
                var matMap = new MaterialMap();
                usdreplacedet.m_metallicWorkflowMaterial = matMap.MetallicWorkflowMaterial;
            }

            if (usdreplacedet.m_specularWorkflowMaterial == null)
            {
                Debug.LogWarning("No specular material set, reverting to default");
                var matMap = new MaterialMap();
                usdreplacedet.m_specularWorkflowMaterial = matMap.SpecularWorkflowMaterial;
            }

            var buttonStyle = new GUIStyle(GUI.skin.button);
            buttonStyle.fixedWidth = 32;
            buttonStyle.fixedHeight = 32;

            var gsImageStyle = new GUIStyle();
            gsImageStyle.alignment = TextAnchor.MiddleCenter;
            gsImageStyle.normal.background = EditorGUIUtility.whiteTexture;
            gsImageStyle.padding.bottom = 0;

            GUILayout.Space(5);
            GUILayout.BeginHorizontal(gsImageStyle);
            EditorGUILayout.LabelField(new GUIContent(m_usdLogo), GUILayout.MinHeight(40.0f));

            var refreshStyle = new GUIStyle(buttonStyle);
            refreshStyle.fixedHeight = 38;
            refreshStyle.fixedWidth = 38;
            if (GUILayout.Button(new GUIContent(m_refreshButton, "Refresh values from USD"), refreshStyle))
            {
                if (EditorUtility.DisplayDialog("Refresh from Source", "Refresh values from USD?\n\n"
                    + "Any object set to import will have it's state updated from USD",
                    "OK", "Cancel"))
                {
                    ReloadFromUsd(usdreplacedet, forceRebuild: false);
                }
            }

            GUILayout.EndHorizontal();

            GUILayout.Space(5);

            GUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
            GUILayout.FlexibleSpace();
            if (IsPrefabInstance(usdreplacedet.gameObject))
            {
                var style = new GUIStyle();
                style.alignment = TextAnchor.MiddleCenter;
                style.fontSize = 12;
                style.wordWrap = true;
                EditorGUILayout.LabelField("Edit prefab for destructive operations", style);
            }
            else
            {
                if (usdreplacedet.transform.childCount == 0)
                {
                    if (GUILayout.Button(new GUIContent(m_reimportButton, "Import from USD"), buttonStyle))
                    {
                        ReloadFromUsd(usdreplacedet, forceRebuild: true);
                    }
                }
                else
                {
                    if (GUILayout.Button(new GUIContent(m_reimportButton, "Reimport from USD (destructive)"),
                        buttonStyle))
                    {
                        if (EditorUtility.DisplayDialog("Reimport from Source",
                            "Destroy and rebuild all USD objects?\n\n"
                            + "Any GameObject with a UsdPrimSource will be destroyed and reimported.",
                            "OK", "Cancel"))
                        {
                            ReloadFromUsd(usdreplacedet, forceRebuild: true);
                        }
                    }
                }

                EditorGUI.BeginDisabledGroup(usdreplacedet.transform.childCount == 0);
                if (GUILayout.Button(new GUIContent(m_trashButton, "Remove USD Contents (destructive)"), buttonStyle))
                {
                    if (EditorUtility.DisplayDialog("Clear Contents", "Destroy all USD objects?\n\n"
                        + "Any GameObject with a UsdPrimSource will be destroyed. "
                        + "These objects can be re-imported but any custom components will be lost.",
                        "OK", "Cancel"))
                    {
                        DestroyAllImportedObjects(usdreplacedet);
                    }
                }

                if (GUILayout.Button(new GUIContent(m_detachButton, "Detach, remove all USD components"), buttonStyle))
                {
                    if (EditorUtility.DisplayDialog("Detach from USD", "Remove all USD components?\n\n"
                        + "USD components will be destroyed (except the Usdreplacedet root), "
                        + "but can be recreated by refreshing from USD.",
                        "OK", "Cancel"))
                    {
                        DetachFromUsd(usdreplacedet);
                    }
                }

                EditorGUI.EndDisabledGroup();
            }

            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();

            if (Application.isPlaying && GUILayout.Button("Reload from USD (Coroutine)"))
            {
                ReloadFromUsdAsCoroutine(usdreplacedet);
            }

            GUILayout.Space(5);

            m_tab = GUILayout.Toolbar(m_tab, kTabNames);
            switch (m_tab)
            {
                case 0:
                    DrawSimpleInspector(usdreplacedet);
                    break;
                case 1:
                    base.DrawDefaultInspector();
                    break;
            }
        }

19 View Source File : DependencyWindow.cs
License : MIT License
Project Creator : vbandi

private void OnGUI()
        {
            // Don't allow the dependency window to be used when the editor is playing.
            if (EditorApplication.isPlaying || EditorApplication.isPaused)
            {
                GUI.enabled = false;
            }

            DrawHeader();
            DrawVerifyreplacedetSerializationMode();
            DrawDependencyGraphStatistics();

            int previousSelectedToolbarIndex = selectedToolbarIndex;
            selectedToolbarIndex = GUILayout.Toolbar(selectedToolbarIndex, toolbarreplacedles);

            if (previousSelectedToolbarIndex != selectedToolbarIndex)
            {
                scrollPosition = Vector2.zero;
            }

            EditorGUILayout.Space();

            if (selectedToolbarIndex == 0)
            {
                replacedetSelection = EditorGUILayout.ObjectField("replacedet Selection", replacedetSelection, typeof(Object), false);
                maxDisplayDepth = EditorGUILayout.IntSlider("Max Display Depth", maxDisplayDepth, 1, 32);

                DrawDependencyGraphForSelection();
            }
            else if (selectedToolbarIndex == 1)
            {
                excludeUnityScenes = EditorGUILayout.Toggle("Exclude Unity Scenes", excludeUnityScenes);

                string tooltip = "Although certain replacedet types may not be directly referenced by other replacedets as tracked via Unity meta files, these replacedets may be utilized and/or necessary to a project in other ways.\n\nThus, this list of replacedet extensions are ignored and always excluded in the list below.\n\n";
                foreach(string extension in replacedetsWhichCanBeUnreferenced)
                {
                    tooltip += extension + "\n";
                }

                EditorGUILayout.LabelField(new GUIContent("Some replacedet types are always excluded", InspectorUIUtility.HelpIcon, tooltip));

                DrawUnreferencedreplacedetList();
            }
        }

19 View Source File : MigrationWindow.cs
License : MIT License
Project Creator : vbandi

private void DrawMigrationToolbars()
        {
            using (new GUILayout.VerticalScope(EditorStyles.helpBox))
            {
                EditorGUILayout.Space();

                using (var check = new EditorGUI.ChangeCheckScope())
                {
                    selectedToolbar = (ToolbarOption)GUILayout.Toolbar((int)selectedToolbar, toolbarreplacedles);
                    if (check.changed)
                    {
                        scrollPosition = Vector2.zero;
                        migrationTool.ClearMigrationList();
                        migrationLog = "";
                    }
                }
            }
        }

19 View Source File : MixedRealityOptimizeWindow.cs
License : MIT License
Project Creator : vbandi

private void OnGUI()
        {
            windowScrollPosition = EditorGUILayout.BeginScrollView(windowScrollPosition);

            MixedRealityInspectorUtility.RenderMixedRealityToolkitLogo();

            // Render replacedle
            using (new EditorGUILayout.HorizontalScope())
            {
                EditorGUILayout.LabelField("Mixed Reality Toolkit Optimize Window", MixedRealityStylesUtility.BoldLargereplacedleStyle);
                InspectorUIUtility.RenderDoreplacedentationButton(OptimizeWindow_URL);
            }

            EditorGUILayout.LabelField("This tool automates the process of updating your project, currently open scene, and material replacedets to recommended settings for Mixed Reality", EditorStyles.wordWrappedLabel);
            EditorGUILayout.Space();

            EditorGUILayout.LabelField("Active Build Target: ", EditorUserBuildSettings.activeBuildTarget.ToString());

            PerfTarget = (PerformanceTarget)EditorGUILayout.Popup("Performance Target", (int)this.PerfTarget, PerformanceTargetEnums);
            EditorGUILayout.HelpBox(PerformanceTargetDescriptions[(int)PerfTarget], MessageType.Info);
            EditorGUILayout.Space();

            if (!XRSettingsUtilities.LegacyXREnabled)
            {
                EditorGUILayout.HelpBox("Virtual reality support is not enabled in player settings", MessageType.Error);
                if (GUILayout.Button("Enable Virtual Reality Support"))
                {
                    XRSettingsUtilities.LegacyXREnabled = true;
                }
            }
            else
            {
                selectedToolbarIndex = GUILayout.Toolbar(selectedToolbarIndex, Toolbarreplacedles);
                if (selectedToolbarIndex == 0)
                {
                    RenderSettingOptimizations();
                }
                else if (selectedToolbarIndex == 1)
                {
                    RenderSceneOptimizations();
                }
                else
                {
                    RenderShaderOptimizations();
                }
            }

            EditorGUILayout.EndScrollView();
        }

19 View Source File : AssetBundleBrowserMain.cs
License : MIT License
Project Creator : wufanjoin

void ModeToggle()
        {
            GUILayout.BeginHorizontal();
            GUILayout.Space(k_ToolbarPadding);
            bool clicked = false;
            switch(m_Mode)
            {
                case Mode.Browser:
                    clicked = GUILayout.Button(m_RefreshTexture);
                    if (clicked)
                        m_ManageTab.ForceReloadData();
                    break;
                case Mode.Builder:
                    GUILayout.Space(m_RefreshTexture.width + k_ToolbarPadding);
                    break;
                case Mode.Inspect:
                    clicked = GUILayout.Button(m_RefreshTexture);
                    if (clicked)
                        m_InspectTab.RefreshBundles();
                    break;
            }

            float toolbarWidth = position.width - k_ToolbarPadding * 4 - m_RefreshTexture.width;
            //string[] labels = new string[2] { "Configure", "Build"};
            string[] labels = new string[3] { "Configure", "Build", "Inspect" };
            m_Mode = (Mode)GUILayout.Toolbar((int)m_Mode, labels, "LargeButton", GUILayout.Width(toolbarWidth) );
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            if(multiDataSource)
            {
                //GUILayout.BeginArea(r);
                GUILayout.BeginHorizontal();

                using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
                {
                    GUILayout.Label("Bundle Data Source:");
                    GUILayout.FlexibleSpace();
                    var c = new GUIContent(string.Format("{0} ({1})", replacedetBundleModel.Model.DataSource.Name, replacedetBundleModel.Model.DataSource.ProviderName), "Select replacedet Bundle Set");
                    if (GUILayout.Button(c , EditorStyles.toolbarPopup) )
                    {
                        GenericMenu menu = new GenericMenu();

                        for (int index = 0; index < m_DataSourceList.Count; index++)
                        {
                            var ds = m_DataSourceList[index];
                            if (ds == null)
                                continue;

                            if (index > 0)
                                menu.AddSeparator("");
                             
                            var counter = index;
                            menu.AddItem(new GUIContent(string.Format("{0} ({1})", ds.Name, ds.ProviderName)), false,
                                () =>
                                {
                                    m_DataSourceIndex = counter;
                                    var thisDataSource = ds;
                                    replacedetBundleModel.Model.DataSource = thisDataSource;
                                    m_ManageTab.ForceReloadData();
                                }
                            );

                        }

                        menu.ShowAsContext();
                    }

                    GUILayout.FlexibleSpace();
                    if (replacedetBundleModel.Model.DataSource.IsReadOnly())
                    {
                        GUIStyle tbLabel = new GUIStyle(EditorStyles.toolbar);
                        tbLabel.alignment = TextAnchor.MiddleRight;

                        GUILayout.Label("Read Only", tbLabel);
                    }
                }

                GUILayout.EndHorizontal();
                //GUILayout.EndArea();
            }
        }