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(); }
private void OnEnable() { m_ModuleInfo = Tools_Public.ReadDate <ModuleDate>("ModuleInfo"); if (m_ModuleInfo == null) { m_ModuleInfo = new ModuleDate(); m_ModuleInfo.Init(); } }
private void HandToggleUI() { EditorGUILayout.Space(); Tools_Public.EnumButton <ExcelType>(ref m_type, position.width); Tools_Public.CenterLabel("---->" + m_type.ToString() + "<----"); EditorGUILayout.Space(); }
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(); }
internal override void OnEnable(EditorWindow editor) { m_date = Tools_Public.ReadDate <LanguageDate>(filepath); if (m_date == null) { m_date = new LanguageDate(); m_date.languagepath = ""; m_date.excelpath = ""; } if (m_date.languagepath == null) { m_date.languagepath = ""; } if (m_date.excelpath == null) { m_date.excelpath = ""; } }
internal void OnEnable() { m_TabData = Tools_Public.ReadDate <FileTemplateTabData>("FileTemplate"); if (m_TabData == null) { InitDate(); } if (m_FileSetting != null) { m_FileSetting.OnEnable(this); } if (m_FilePrevew != null) { m_FilePrevew.OnEnable(this); } }
/// <summary> /// 头部开关按钮 /// </summary> void HandToggleUI() { EditorGUILayout.Space(); Tools_Public.EnumButton <mode>(ref m_Mode, position.width); //GUILayout.BeginHorizontal(); //GUILayout.Space(k_ToolbarPadding); //float toolbarWidth = (position.width - k_ToolButtonspacing * ((int)mode.Count) - k_ToolbarPadding * 2) / ((int)mode.Count); //for (int i = 0; i < (int)mode.Count; i++) //{ // string tempName = ((mode)i).ToString(); // if (GUILayout.Button(tempName, GUILayout.Width(toolbarWidth))) // { // m_Mode = (mode)i; // } //} //GUILayout.EndHorizontal(); }
internal override void OnDisable() { Tools_Public.SaveDate(filepath, m_date); }
internal void OnDisable() { Tools_Public.SaveDate("FileTemplate", m_TabData); }
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(); }
private void OnDisable() { Tools_Public.SaveDate("ModuleInfo", m_ModuleInfo); }