static void InitForAndroidBuild() { // 清空下载目录 DownloadList _instance = DownloadList.GetInstance(); if (_instance != null) { _instance.Clear(true); } BuildSettings.GetInstance(BuildSettings.AssetFileDir); // 清空Plugins/Android目录 ClearPluginsAndroid(); // 重置Plugins/Android ResetPluginsAndroid(); // 设置相关AndroidSDK相关设定 IAndroidSDKSettings androidSDK = GetCurAndroidSDKSetting(); if (androidSDK != null) { string gameName = BuildInfo.GetInstance().BuildName; string packageName = BuildInfo.GetInstance().BuildID; // 打包Android(apk文件)之前,提前应用设定 androidSDK.PreApplyAndroidBuild(gameName, packageName); } else { BuildLogger.LogWarning("Android SDK invalid!!"); } // 刷新 UtilsAsset.AssetsRefresh(); }
static void InitForAndroidBuild() { // 清空下载目录 DownloadList _instance = DownloadList.GetInstance(); if (_instance != null) { _instance.Clear(true); } // 初始化打包信息 BuildSettings.GetInstance(BuildSettings.AssetFileDir); #if UNITY_ANDROID // 设定选项 // 天鸽的场合 if (TPlatformType.Tiange == BuildInfo.GetInstance().PlatformType) { // 初始化SDK设定信息&导入最新 TiangeSDKSettings.GetInstance(TiangeSDKSettings.AssetFileDir).ImportFromJsonFile(true); BuildLogger.LogMessage("TiangeSDKSettings -> ImportFromJsonFile()."); BuildLogger.LogMessage("TiangeSDKSettings::OneSDK:{0}(MetaData:{1}).", TiangeSDKSettings.GetInstance().Data.Options.isOptionValid(BuildSystem.Options.TSDKOptions.OneSDK).ToString(), TiangeSDKSettings.GetInstance().Data.Options.OneSDK.MetaDatas.Count.ToString()); TiangeSDKSettings.GetInstance().Data.Options.OptionsSettings = BuildInfo.GetInstance().Data.Options.OptionsSettings; } // 清空Plugins/Android目录 ClearPluginsAndroid(); // 重置Plugins/Android ResetPluginsAndroid(); // 设置相关AndroidSDK相关设定 IAndroidSDKSettings androidSDK = GetCurAndroidSDKSetting(); if (androidSDK != null) { string gameName = BuildInfo.GetInstance().BuildName; string packageName = BuildInfo.GetInstance().BuildID; // 打包Android(apk文件)之前,提前应用设定 androidSDK.PreApplyAndroidBuild(gameName, packageName); } else { BuildLogger.LogWarning("Android SDK invalid!!"); } #endif // 刷新 UtilsAsset.AssetsRefresh(); }
/// <summary> /// 取得当前AndroidSDK设定信息. /// </summary> /// <returns>当前AndroidSDK设定信息.</returns> static IAndroidSDKSettings GetCurAndroidSDKSetting() { IAndroidSDKSettings settings = null; // 平台类型 TPlatformType platformType = BuildInfo.GetInstance().PlatformType; BuildLogger.LogMessage("PlatformType:{0}.", platformType.ToString()); switch (platformType) { // 华为 case TPlatformType.Huawei: { settings = HuaweiSDKSettings.GetInstance(); } break; // 天鸽 case TPlatformType.Tiange: { settings = TiangeSDKSettings.GetInstance(); } break; case TPlatformType.None: case TPlatformType.iOS: default: { // 清空/Plugins/Android下的文件 } break; } return(settings); }