Beispiel #1
0
        private void DrawModeControls(NavGridTool tool)
        {
            GUILayout.BeginHorizontal("box");
            {
                // Render Toggle
                if (NavGridTool3DGUI.currentMode == NavGridTool3DGUI.Mode.RENDER || NavGridTool3DGUI.currentMode == NavGridTool3DGUI.Mode.EDIT)
                {
                    if (GUILayout.Button("Disable Render"))
                    {
                        tool.GUI3D.SetMode(NavGridTool3DGUI.Mode.DISABLED);
                        tool.UnselectNode();
                    }
                }
                else
                {
                    if (GUILayout.Button("Enable Render"))
                    {
                        tool.GUI3D.SetMode(NavGridTool3DGUI.Mode.RENDER);
                    }
                }

                // View | Edit Mode
                if (NavGridTool3DGUI.currentMode == NavGridTool3DGUI.Mode.DISABLED)
                {
                    GUILayout.Button("...");
                }
                else
                {
                    if (NavGridTool3DGUI.currentMode == NavGridTool3DGUI.Mode.RENDER)
                    {
                        if (GUILayout.Button("Edit Mode ->"))
                        {
                            tool.GUI3D.SetMode(NavGridTool3DGUI.Mode.EDIT);
                            tool.RegenerateSubGrids();
                        }
                    }
                    else if (NavGridTool3DGUI.currentMode == NavGridTool3DGUI.Mode.EDIT)
                    {
                        if (GUILayout.Button("Render Mode ->"))
                        {
                            tool.GUI3D.SetMode(NavGridTool3DGUI.Mode.RENDER);
                            tool.UnselectNode();
                        }
                    }
                }
            }
            GUILayout.EndHorizontal();
        }
Beispiel #2
0
        private void DrawToolsMenu(NavGridTool tool)
        {
            int selectedTool = tool.SelectedTool;

            GUILayout.Label("Tools", EditorStyles.boldLabel);
            GUILayout.BeginHorizontal("box");
            {
                GUILayout.FlexibleSpace();

                string[] toolLabels = new string[] { "Select", "Single", "Square", "Wall Mode" };

                int newTool = GUILayout.SelectionGrid(
                    selectedTool,
                    toolLabels,
                    4,
                    EditorStyles.toolbarButton,
                    GUILayout.Width(300));

                if (newTool != selectedTool)
                {
                    tool.SelectedTool = newTool;
                    tool.UnselectNode();
                }

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