static void Menu_ImportGamePackets() { //创建窗口 Rect wr = new Rect(0, 0, 300, 400); UI_ResPacketsImport window = (UI_ResPacketsImport)EditorWindow.GetWindowWithRect(typeof(UI_ResPacketsImport), wr, true, "Import GamePackets"); window.m_TargetPlatform = TargetPlatformTools.GetCurPlatform(); window.Show(); }
public static void GUI_Item(TargetPlatform pt, ref TargetPlatform selectdPt) { GUIContent title = new GUIContent(TargetPlatformTools.Enum2Str(pt)); if (EditorGUILayout.ToggleLeft(title, selectdPt == pt) && selectdPt != pt) { selectdPt = pt; } }
static void Menu_Make() { //创建窗口 Rect wr = new Rect(0, 0, 300, 300); UI_LuaPacket window = (UI_LuaPacket)EditorWindow.GetWindowWithRect(typeof(UI_LuaPacket), wr, true, "Make LuaPacket"); window.m_TargetPlatform = TargetPlatformTools.GetCurPlatform(); window.Show(); }
public static void GUI_ItemList(ref TargetPlatform selectdPt, bool canSelectAll) { EditorGUILayout.LabelField(new GUIContent("选择目标平台")); if (canSelectAll) { TargetPlatformTools.GUI_Item(TargetPlatform.all, ref selectdPt); } TargetPlatformTools.GUI_Item(TargetPlatform.ios, ref selectdPt); TargetPlatformTools.GUI_Item(TargetPlatform.android, ref selectdPt); TargetPlatformTools.GUI_Item(TargetPlatform.win32, ref selectdPt); TargetPlatformTools.GUI_Item(TargetPlatform.win64, ref selectdPt); }
//绘制窗口时调用 void OnGUI() { m_ScrollPos = EditorGUILayout.BeginScrollView(m_ScrollPos, false, false); { //选择目标平台 TargetPlatformTools.GUI_ItemList(ref m_TargetPlatform, false); GUILayout.Space(25); if (m_dirs == null) { m_dirs = BuildTagList(out m_CurrResTag); } //选择资源版本 GUI_SelectTag(m_dirs, ref m_CurrResTag); GUILayout.Space(25); m_CleanOnMakePack = EditorGUILayout.ToggleLeft(new GUIContent("导入前先清理"), m_CleanOnMakePack); GUILayout.Space(25); if (GUILayout.Button("导入资源包", GUILayout.Width(100))) { ImportGamePackets(m_TargetPlatform, m_CurrResTag, m_CleanOnMakePack); //关闭窗口 this.Close(); } GUILayout.Space(25); EncryptUI(); } EditorGUILayout.EndScrollView(); }