void GetToggle(ChannelType type) { Array configs = Enum.GetValues(typeof(SidConfig)); using (var h = new EditorGUILayout.VerticalScope(GUILayout.Width(channelWidth))) { using (var scrollView = new EditorGUILayout.ScrollViewScope(typeScrpllPos[type], false, false, GUILayout.Height(200))) { typeScrpllPos[type] = scrollView.scrollPosition; channelTypes[type] = EditorGUILayout.BeginToggleGroup(EnumExtension.GetChannelTypeAttribute(type).ShowName, channelTypes[type]); for (int i = 0; i < configs.Length; i++) { SidConfig config = (SidConfig)configs.GetValue(i); sidConfigs[type][config] = EditorGUILayout.ToggleLeft(config.GetDesc(), sidConfigs[type][config], GUILayout.Width(channelWidth - 30)); } EditorGUILayout.EndToggleGroup(); } } }
static BuildConfig CreateBuildConfig(ChannelType channelType, SidConfig sidConfig) { BuildConfig buildConfig = new BuildConfig(); buildConfig.id = sidConfig.GetSid(); buildConfig.bundleVersionCode = AppConst.VersionCode; buildConfig.bundleIdentifier = sidConfig.GetBundleId(channelType); buildConfig.bundleVersion = AppConst.OsVersion; buildConfig.companyName = EnumExtension.GetChannelTypeAttribute(channelType).CompanyName; buildConfig.productName = EnumExtension.GetChannelTypeAttribute(channelType).ShowName; buildConfig.keystorePath = "Tools/KeyStore/Ninek.jks"; buildConfig.keystorePass = "******"; buildConfig.keyaliasName = "ninek"; buildConfig.keyaliasPass = "******"; buildConfig.apkName = string.Format("{0}-{1}-latest", EnumExtension.GetChannelTypeAttribute(channelType).ShortName, sidConfig.GetSid()); return(buildConfig); }
private void OnGUI() { GUILayout.Space(20); isBackup = EditorGUILayout.Toggle(isBackup ? "当前您选中的是备份" : "当前您选中的是还原", isBackup); if (isBackup) { // 猜测当前包是什么 EditorGUILayout.LabelField("当前渠道所采用的路径为: " + channelFolder); GUILayout.Space(10); isCustom = EditorGUILayout.Toggle(isCustom ? "使用自定义路径" : "使用默认路径", isCustom); if (isCustom) { GUILayout.Space(10); channelType = (ChannelType)EditorGUILayout.EnumPopup(channelType); channelFolder = EnumExtension.GetChannelTypeAttribute(channelType).ChannelFolder; } else { channelFolder = AppConst.sidConfig.GetChannelFolder(AppConst.channelType); } GUILayout.Space(10); if (GUILayout.Button("将当前资源备份到该路径下")) { BackupCurChannel(channelFolder); } GUILayout.Space(20); } else { EditorGUILayout.LabelField("选择要恢复的路径"); GUILayout.Space(10); channelType = (ChannelType)EditorGUILayout.EnumPopup(channelType); channelFolder = EnumExtension.GetChannelTypeAttribute(channelType).ChannelFolder; GUILayout.Space(10); if (GUILayout.Button("从 " + channelFolder + " 路径下恢复")) { ResetTOChannel(channelFolder); } } }