Example #1
0
        void OnGUI()
        {
            if (_titleStyle == null)
            {
                _titleStyle          = new GUIStyle();
                _titleStyle.richText = true;
            }

            AddButton("帮助", () =>
            {
                AOCtrlerAutoGenerateHelp.AddWindow();
            });

            scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUILayout.Width(position.width), GUILayout.Height(position.height));

            // AoCtrler
            GUILayout.Space(10);
            GUILayout.Label("<color=" + _strColorAOSet + ">将要编辑的AudioController拖进来</color>", _titleStyle);
            GUILayout.Space(10);
            _aoCtrler = EditorGUILayout.ObjectField(_aoCtrler, typeof(AudioController), true, GUILayout.Width(_nWidth0)) as AudioController;
            if (_aoCtrler != null)
            {
                _strColorAOSet = "cyan";
            }
            // 目录
            EditorGUILayout.BeginVertical();
            if (_strFolderRoot != null &&
                _strFolderRoot.Length > 0)
            {
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.LabelField("<color=cyan>" + _strFolderRoot + "</color>", _titleStyle);
                EditorGUILayout.EndHorizontal();
                AddButton("遍历生成", () =>
                {
                    GenerateData(_strFolderRoot, _dictName);
                    GenerateAOCtrl(_aoCtrler, _dictName);
                    ShowNotification(new GUIContent("生成完成!"));
                });
            }
            else
            {
                EditorGUILayout.LabelField("<color=red>" + "选择音效根目录" + "</color>", _titleStyle);
            }
            AddButton("选择音效根目录", () =>
            {
                _strFolderRoot = EditorUtility.OpenFolderPanel("音效根目录", _strFolderRoot.Length > 0 ? _strFolderRoot : Application.dataPath, "");
            });
            EditorGUILayout.EndVertical();


            EditorGUILayout.EndScrollView();
        }
Example #2
0
        public static void AddWindow()
        {
            AOCtrlerAutoGenerateHelp window = (AOCtrlerAutoGenerateHelp)EditorWindow.GetWindow <AOCtrlerAutoGenerateHelp>("音效自动配置器帮助");

            window.Show();
        }