/// <summary>
 /// ヘッダーを表示する
 /// </summary>
 /// <param name="text"></param>
 private void Header(string text)
 {
     using (new GUILayout.HorizontalScope())
     {
         GUISupport.SetFontSizeLabel(HEADER_FONT_SIZE, text);
     }
 }
 /// <summary>
 /// タイトルを表記する
 /// </summary>
 private void Title()
 {
     using (new GUILayout.HorizontalScope())
     {
         GUISupport.Centered(TITLE_FONT_SIZE, WINDOW_NAME);
     }
     EditorGUILayout.Space();
 }
        /// <summary>
        /// GUIの設定
        /// </summary>
        private void OnGUI()
        {
            EditorGUILayout.Space();
            //タイトル
            Title();
            GUISupport.DrawLineHoraizontal();

            //input
            Header("Input");
            EditorGUILayout.Space();

            LoadObjectDirectory();

            LoadDirectoryOption();

            MapSize();
            GUISupport.DrawLineHoraizontal();

            //OutPot
            Header("Output");
            EditorGUILayout.Space();

            SetEmptyObject();

            EditorGUILayout.HelpBox("The input object can't have any children if it has them.", MessageType.Info);
            EditorGUILayout.Space();

            GUISupport.DrawLineHoraizontal();

            //Start
            Header("Start");
            OpenEditor();

            GUISupport.DrawLineHoraizontal();

            ViewLoadObjects();
        }
Exemple #4
0
        /// <summary>
        /// タブの表示
        /// </summary>
        private void ToolBar()
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, GUILayout.ExpandWidth(true));
            {
                //ボタンの準備
                GUIContent paintToggle  = new GUIContent("Paint");
                GUIContent eraserToggle = new GUIContent("Eraser");
                GUIContent bucketToggle = new GUIContent("Bucket");


                //書き出し
                if (GUILayout.Button("Export", EditorStyles.toolbarButton, GUILayout.Width(70))) //! 出力
                {
                    Export();
                }

                //塗り
                paint = GUILayout.Toggle(paint, paintToggle, EditorStyles.toolbarButton, GUILayout.Width(70));
                if (paint)
                {
                    selectEvent = MouseEvents.paint;
                    eraser      = false;
                    bucket      = false;
                }

                //消しゴム
                eraser = GUILayout.Toggle(eraser, eraserToggle, EditorStyles.toolbarButton, GUILayout.Width(70));
                if (eraser)
                {
                    selectEvent = MouseEvents.eraser;
                    paint       = false;
                    bucket      = false;
                }

                //バケツ
                bucket = GUILayout.Toggle(bucket, bucketToggle, EditorStyles.toolbarButton, GUILayout.Width(70));
                if (bucket)
                {
                    selectEvent = MouseEvents.bucket;
                    paint       = false;
                    eraser      = false;
                }
            }
            EditorGUILayout.EndHorizontal();


            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, GUILayout.ExpandWidth(true));
            {
                GUILayout.Label("Grid Size");
                //グリッドサイズの変更
                gridSize = EditorGUILayout.Slider((gridSize / 10), 1, 10, GUILayout.Width(150)) * 10;
                GUISupport.DrawLineVertical();


                GUILayout.Label("Parent Number");
                //親番号
                parentNumber = (int)EditorGUILayout.Slider(parentNumber, 0, 100, GUILayout.Width(150));


                GUILayout.Label("Pallet Size");
                //パレットのサイズ
                canvasSize = EditorGUILayout.Slider(canvasSize, 1, 10, GUILayout.Width(150));
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(1);
        }