Пример #1
0
    //-----------------------------------------------------
    //
    //-----------------------------------------------------
    void OnGUI()
    {
        using (new EditorGUILayout.HorizontalScope())
        {
            stageData = (StageData)EditorGUILayout.ObjectField("StageData", stageData, typeof(StageData), true);
            if (GUILayout.Button("New", GUILayout.Width(50)))
            {
                Debug.Log("ここから過程大事に");
            }
        }

        EditorGUILayout.Space();

        EditorGUI.BeginChangeCheck();
        {
            toolType = (ToolType)GUILayout.Toolbar((int)toolType, new string[] { "Tile3D", "Stage" }, (GUIStyle)"OL Titlemid");
        }
        if (EditorGUI.EndChangeCheck())
        {
            if (toolType == ToolType.Tile3D)
            {
                if (tiler == null)
                {
                    tiler = FindObjectOfType <Tile3D>();
                }
                Selection.activeGameObject = tiler.gameObject;

                Debug.Log("AB");
            }
            else
            if (toolType == ToolType.Stage)
            {
                if (builder == null)
                {
                    builder = FindObjectOfType <StageBuilder>();
                }
                Selection.activeGameObject = builder.gameObject;

                Debug.Log("CD");
            }
        }

        if (toolType == ToolType.Tile3D)
        {
            tileTool = (Tile3DTool)GUILayout.Toolbar((int)tileTool, new string[] { "Mesh", "Paint" }, (GUIStyle)"OL Titlemid");
        }
        else
        if (toolType == ToolType.Stage)
        {
            stageTool = (StageTool)GUILayout.Toolbar((int)stageTool, new string[] { "Data", "Gimick", "Respawn", "Right", "Left" }, (GUIStyle)"OL Titlemid");
        }
    }
Пример #2
0
    protected virtual void OnSceneGUI()
    {
        Handles.BeginGUI();
        {
            toolMode = (ToolMode)GUI.Toolbar(new Rect(10, 10, 200, 20), (int)toolMode, new[] { "Mesh", "Data" });

            // meshTool
            if (toolMode == ToolMode.Mesh)
            {
                meshTool = (MeshTool)GUI.Toolbar(new Rect(10, 35, 200, 20), (int)meshTool, new[] { "Build", "Paint" });
                //if (meshTool == MeshTool.Painting)
                //    selected = null;

                //// tileset
                //if (meshTool == MeshTool.Painting)
                //    GUI.Window(0, new Rect(10, 80, 200, 300), PaintingWindow, "Tiles");
            }
            else
            if (toolMode == ToolMode.Stage)
            {
                stageTool = (StageTool)GUI.Toolbar(new Rect(10, 35, 200, 20), (int)stageTool, new[] { "Data", "Gimick", "Back" });

                //// Data
                //if (stageTool == StageTool.Data)
                //    GUI.Window(0, new Rect(10, 80, 200, 300), DataWindow, "Data");

                //// Gimick
                //if (stageTool == StageTool.Gimick)
                //    GUI.Window(0, new Rect(10, 80, 200, 300), GimickWindow, "Gimick");

                //// Back
                //if (stageTool == StageTool.BackPoint)
                //    GUI.Window(0, new Rect(10, 80, 200, 300), BackWindow, "BackPoint");
            }
        }
        Handles.EndGUI();
    }
Пример #3
0
    protected virtual void OnSceneGUI()
    {
        // 選択状況の保存データ
        SelectInitialize();

        // overlay gui
        Handles.BeginGUI();
        {
            toolMode = (ToolMode)GUI.Toolbar(new Rect(10, 10, 200, 20), (int)toolMode, new[] { "Move", "Mesh", "Data" });

            // meshTool
            if (toolMode == ToolMode.Mesh)
            {
                meshTool = (MeshTool)GUI.Toolbar(new Rect(10, 35, 200, 20), (int)meshTool, new[] { "Build", "Paint" });
                if (meshTool == MeshTool.Painting)
                {
                    selected = null;
                }

                // tileset
                if (meshTool == MeshTool.Painting)
                {
                    GUI.Window(0, new Rect(10, 80, 200, 300), PaintingWindow, "Tiles");
                }
            }
            else
            if (toolMode == ToolMode.Stage)
            {
                stageTool = (StageTool)GUI.Toolbar(new Rect(10, 35, 200, 20), (int)stageTool, new[] { "Data", "Gimick", "Back" });

                // Data
                if (stageTool == StageTool.Data)
                {
                    GUI.Window(0, new Rect(10, 80, 200, 300), DataWindow, "Data");
                }

                // Gimick
                if (stageTool == StageTool.Gimick)
                {
                    GUI.Window(0, new Rect(10, 80, 200, 300), GimickWindow, "Gimick");
                }

                // Back
                if (stageTool == StageTool.BackPoint)
                {
                    GUI.Window(0, new Rect(10, 80, 200, 300), BackWindow, "BackPoint");
                }
            }
        }
        Handles.EndGUI();

        if (toolMode == ToolMode.Transform)
        {
            TransformMove();
            return;
        }

        DefaultControll();

        if (toolMode == ToolMode.Mesh)
        {   // Mesh作成
            switch (meshTool)
            {
            case MeshTool.Building: MeshToolBuild(); break;

            case MeshTool.Painting: MeshToolPaint(); break;
            }
        }
        else
        if (toolMode == ToolMode.Stage)
        {   // 情報の登録
            //ActiveHover();

            switch (stageTool)
            {
            case StageTool.Data: StageToolData(); break;

            case StageTool.Gimick: StageToolGimick(); break;

            case StageTool.BackPoint: StageToolBackPoint(); break;
            }
        }
        // 描画
        Drawing();

        // 塗りなおし
        if (invokeRepaint)
        {
            Repaint();
        }

        // always keep the tiler selected for now
        // later should detect if something is being grabbed or hovered
        Selection.activeGameObject = tiler.transform.gameObject;
    }