internal override void OnGUI() { EditorGUILayout.BeginVertical(); //Excel ·¾¶ using (new EditorGUI.DisabledScope()) { m_date.excelpath = EditorGUILayout.TextField("Excel Path", m_date.excelpath); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("OpenFile", GUILayout.MaxWidth(Tools_Public.Tools_MinButtonWidth))) { var newPath = EditorUtility.OpenFolderPanel("OpenFile", Application.dataPath, ""); if (!string.IsNullOrEmpty(newPath)) { newPath = newPath.Replace("\\", "/"); m_date.excelpath = newPath; } } EditorGUILayout.EndHorizontal(); } //µ¼³ö import using (new EditorGUI.DisabledScope()) { if (Tools_Public.CenterButton("Export Excel", GUILayout.Width(Tools_Public.Tools_MaxButtonWidth))) { } } EditorGUILayout.EndVertical(); }
internal override void OnGUI() { EditorGUILayout.BeginVertical(); //Excel 路径 using (new EditorGUI.DisabledScope()) { m_date.excelpath = EditorGUILayout.TextField("Excel Path", m_date.excelpath); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("ReadFile", GUILayout.MaxWidth(Tools_Public.Tools_MinButtonWidth))) { } if (GUILayout.Button("OpenFile", GUILayout.MaxWidth(Tools_Public.Tools_MinButtonWidth))) { var newPath = EditorUtility.OpenFilePanel("OpenFile", Application.dataPath, "xlsx,xls"); if (!string.IsNullOrEmpty(newPath)) { newPath = newPath.Replace("\\", "/"); m_date.excelpath = newPath; } } EditorGUILayout.EndHorizontal(); } //Language 路径 using (new EditorGUI.DisabledScope()) { m_date.languagepath = EditorGUILayout.TextField("Language Path", m_date.languagepath); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("OpenFile", GUILayout.MaxWidth(Tools_Public.Tools_MinButtonWidth))) { var newPath = EditorUtility.OpenFolderPanel("OpenFile", Application.dataPath + "/" + m_date.languagepath, ""); if (!string.IsNullOrEmpty(newPath)) { newPath = newPath.Replace("\\", "/"); var temppath = Application.dataPath.Replace("\\", "/"); newPath = newPath.Replace(temppath + "/", ""); m_date.languagepath = newPath; } } EditorGUILayout.EndHorizontal(); } //导入 import using (new EditorGUI.DisabledScope()) { m_date.m_SaveType = (LanguageType)EditorGUILayout.EnumPopup("Save File Type", m_date.m_SaveType); if (Tools_Public.CenterButton("Import Excel", GUILayout.Width(Tools_Public.Tools_MaxButtonWidth))) { ImportExcelFile(); AssetDatabase.Refresh(); } } EditorGUILayout.EndVertical(); }
private void CreateModuleUI() { if (string.IsNullOrEmpty(m_ModuleInfo.ModulePath)) { m_ModuleInfo.Init(); } m_ScrollPosition = EditorGUILayout.BeginScrollView(m_ScrollPosition); GUILayout.BeginVertical(); EditorGUILayout.Space(); //文件信息 using (new EditorGUI.DisabledScope()) { m_ModuleInfo.ModulePath = EditorGUILayout.TextField("Folder Path", m_ModuleInfo.ModulePath); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("OpenFile", GUILayout.MaxWidth(Tools_Public.Tools_MinButtonWidth))) { var newPath = EditorUtility.OpenFolderPanel("OpenFile", Application.dataPath, ""); if (!string.IsNullOrEmpty(newPath)) { newPath = newPath.Replace("\\", "/"); var temppath = Application.dataPath.Replace("\\", "/"); if (newPath.Contains(temppath)) { m_ModuleInfo.ModulePath = newPath.Replace(temppath, ""); m_ModuleInfo.ModulePath = m_ModuleInfo.ModulePath.TrimStart('/'); } } } if (GUILayout.Button("UpDate", GUILayout.MaxWidth(Tools_Public.Tools_MinButtonWidth))) { m_ModuleInfo.Init(); } GUILayout.EndHorizontal(); } //模块信息 using (new EditorGUI.DisabledScope()) { EditorGUILayout.Space(); m_ModuleInfo.ModuleName = EditorGUILayout.TextField("Module Name", m_ModuleInfo.ModuleName); if (Tools_Public.RightButton("Switch Module", GUILayout.Width(Tools_Public.Tools_ButtonWidth))) { SwitchModule(); } m_ModuleInfo.ModuleTips = EditorGUILayout.TextField("Module Tips", m_ModuleInfo.ModuleTips); m_ModuleInfo.IsVideoPlayer = EditorGUILayout.Toggle("VideoPlayer", m_ModuleInfo.IsVideoPlayer); m_ModuleInfo.IsAnimations = EditorGUILayout.Toggle("Animations", m_ModuleInfo.IsAnimations); m_ModuleInfo.IsAudioClip = EditorGUILayout.Toggle("AudioClip", m_ModuleInfo.IsAudioClip); m_ModuleInfo.IsTexture = EditorGUILayout.Toggle("Texture", m_ModuleInfo.IsTexture); m_ModuleInfo.IsShader = EditorGUILayout.Toggle("Shader", m_ModuleInfo.IsShader); m_ModuleInfo.IsUI = EditorGUILayout.Toggle("UI", m_ModuleInfo.IsUI); m_ModuleInfo.IsTxt = EditorGUILayout.Toggle("Txt", m_ModuleInfo.IsTxt); } //创建模块 using (new EditorGUI.DisabledScope()) { if (Tools_Public.CenterButton("Create Module", GUILayout.MaxWidth(Tools_Public.Tools_MaxButtonWidth))) { string temp_path = Application.dataPath + "/" + m_ModuleInfo.ModulePath; CreateFolder(temp_path, m_ModuleInfo.ModuleName, m_ModuleInfo.ModuleTips); } } GUILayout.EndVertical(); EditorGUILayout.EndScrollView(); }