| | |
| | | using System.Text.RegularExpressions;
|
| | | using System.Text;
|
| | | using TableConfig;
|
| | | using Beebyte.Obfuscator;
|
| | |
|
| | | public class ClientPackage
|
| | | {
|
| | |
| | | public static string SDK_PLUGIN_PROJECT {
|
| | | get { return LocalSave.GetString("SDK_PROJECT_PATH"); }
|
| | | set { LocalSave.SetString("SDK_PROJECT_PATH", value); }
|
| | | }
|
| | |
|
| | | public static bool obfuscatorEnabled {
|
| | | get { return LocalSave.GetBool("obfuscatorEnabled",false); }
|
| | | set { LocalSave.SetBool("obfuscatorEnabled", value); }
|
| | | }
|
| | |
|
| | | static string ANDROID_PLUGIN_PATH = Application.dataPath + "/Plugins/Android";
|
| | |
| | |
|
| | | if (smallPackages.Count > 0)
|
| | | {
|
| | | FileExtersion.DirectoryCopy(_assetBundlePath, ResourcesPath.Instance.StreamingAssetPath);
|
| | |
|
| | | var files = new List<FileInfo>();
|
| | | FileExtersion.GetAllDirectoryFileInfos(ResourcesPath.Instance.StreamingAssetPath, files);
|
| | | foreach (var file in files)
|
| | | {
|
| | | var fileName = Path.GetFileName(file.FullName);
|
| | | if (fileName.Contains("builtin"))
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | if (file.FullName.Contains("config/Contact.txt")
|
| | | || file.FullName.Contains("config/HelpInfo.txt")
|
| | | || file.FullName.Contains("config/PriorBundle.txt")
|
| | | || file.FullName.Contains("config/PriorLanguage.txt"))
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | File.Delete(file.FullName);
|
| | | }
|
| | |
|
| | | for (int i = 0; i < smallPackages.Count; i++)
|
| | | {
|
| | | #if UNITY_ANDROID
|
| | |
| | | Debug.LogFormat("执行Android SDK 文件拷贝,from:{0};to:{1}", StringUtility.Contact(_sdkPath, "/Android/release"), ANDROID_PLUGIN_PATH);
|
| | | FileExtersion.DirectoryCopy(StringUtility.Contact(_sdkPath, "/Android/release"), ANDROID_PLUGIN_PATH);
|
| | | FileExtersion.DirectoryCopy(StringUtility.Contact(_sdkPath, "/ChannelDiff/Android/", versionConfig.appId), ANDROID_PLUGIN_PATH);
|
| | |
|
| | | var option = AssetDatabase.LoadAssetAtPath<Options>("Assets/Editor/Beebyte/Obfuscator/ObfuscatorOptions.asset");
|
| | | if (option!=null)
|
| | | {
|
| | | option.enabled = obfuscatorEnabled;
|
| | | EditorUtility.SetDirty(option);
|
| | | }
|
| | |
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | |
|
| | |
| | | DateTime outTime;
|
| | | var correct = DateTime.TryParse(auditOutTime, out outTime);
|
| | | File.WriteAllText(Application.dataPath + Path.DirectorySeparatorChar + "Resources/Config/AuditTime.txt", correct ? auditOutTime : "");
|
| | | |
| | | var option = AssetDatabase.LoadAssetAtPath<Options>("Assets/Editor/Beebyte/Obfuscator/ObfuscatorOptions.asset");
|
| | | if (option!=null)
|
| | | {
|
| | | option.enabled = obfuscatorEnabled;
|
| | | EditorUtility.SetDirty(option);
|
| | | }
|
| | | |
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | PlayerSettings.iOS.buildNumber = VersionConfig.Get().buildIndex.ToString();
|
| | |
| | | projectSettings.ApplyModifiedProperties();
|
| | |
|
| | | PlayerSettings.Android.splashScreenScale = AndroidSplashScreenScale.ScaleToFill;
|
| | | }
|
| | |
|
| | | var logoFromPath = "Assets/Editor/Logo/" + _versionName + "/TB_DL_Logo.png";
|
| | | var logoToPath = "Assets/Resources/UI/Sprites/TB_DL_Logo.png";
|
| | | AssetDatabase.DeleteAsset(logoToPath);
|
| | | AssetDatabase.CopyAsset(logoFromPath, logoToPath);
|
| | |
|
| | | var logoImporterPath = "Assets/Resources/UI/Sprites/TB_DL_Logo.png";
|
| | | var logoImporter = AssetImporter.GetAtPath(logoImporterPath);
|
| | | var logoTextureImporter = logoImporter as TextureImporter;
|
| | | if (logoTextureImporter != null)
|
| | | {
|
| | | logoTextureImporter.textureType = TextureImporterType.Sprite;
|
| | | logoTextureImporter.spritePackingTag = string.Empty;
|
| | | logoTextureImporter.assetBundleName = string.Empty;
|
| | |
|
| | | var platformSetting = new TextureImporterPlatformSettings();
|
| | | switch (buildTarget)
|
| | | {
|
| | | case BuildTargetGroup.Android:
|
| | | platformSetting.overridden = true;
|
| | | platformSetting.allowsAlphaSplitting = false;
|
| | | platformSetting.name = "Android";
|
| | | platformSetting.maxTextureSize = 512;
|
| | | platformSetting.format = TextureImporterFormat.ETC2_RGBA8;
|
| | | platformSetting.compressionQuality = 1;
|
| | | break;
|
| | | case BuildTargetGroup.iOS:
|
| | | platformSetting.overridden = true;
|
| | | platformSetting.allowsAlphaSplitting = false;
|
| | | platformSetting.name = "iOS";
|
| | | platformSetting.maxTextureSize = 512;
|
| | | platformSetting.format = TextureImporterFormat.PVRTC_RGBA4;
|
| | | platformSetting.compressionQuality = 1;
|
| | | break;
|
| | | }
|
| | |
|
| | | logoTextureImporter.SetPlatformTextureSettings(platformSetting);
|
| | | AssetDatabase.ImportAsset(logoImporterPath);
|
| | | EditorUtility.SetDirty(logoTextureImporter);
|
| | | }
|
| | |
|
| | | var backGroundFromPath = "Assets/Editor/Logo/" + _versionName + "/Launch.png";
|
| | | var backGroundToPath = "Assets/Resources/UI/Sprites/Launch.png";
|
| | | AssetDatabase.DeleteAsset(backGroundToPath);
|
| | | AssetDatabase.CopyAsset(backGroundFromPath, backGroundToPath);
|
| | |
|
| | | var backGroundImporterPath = "Assets/Resources/UI/Sprites/Launch.png";
|
| | | var backGrouindImporter = AssetImporter.GetAtPath(backGroundImporterPath);
|
| | | var backGroundTextureImporter = backGrouindImporter as TextureImporter;
|
| | | if (backGroundTextureImporter != null)
|
| | | {
|
| | | backGroundTextureImporter.textureType = TextureImporterType.Sprite;
|
| | | backGroundTextureImporter.spritePackingTag = string.Empty;
|
| | | backGroundTextureImporter.assetBundleName = string.Empty;
|
| | |
|
| | | var platformSetting = new TextureImporterPlatformSettings();
|
| | | switch (buildTarget)
|
| | | {
|
| | | case BuildTargetGroup.Android:
|
| | | platformSetting.overridden = true;
|
| | | platformSetting.allowsAlphaSplitting = false;
|
| | | platformSetting.name = "Android";
|
| | | platformSetting.maxTextureSize = 1024;
|
| | | platformSetting.format = TextureImporterFormat.ETC2_RGB4;
|
| | | platformSetting.compressionQuality = 1;
|
| | | break;
|
| | | case BuildTargetGroup.iOS:
|
| | | platformSetting.overridden = true;
|
| | | platformSetting.allowsAlphaSplitting = false;
|
| | | platformSetting.name = "iOS";
|
| | | platformSetting.maxTextureSize = 1024;
|
| | | platformSetting.format = TextureImporterFormat.PVRTC_RGBA4;
|
| | | platformSetting.compressionQuality = 1;
|
| | | break;
|
| | | }
|
| | |
|
| | | backGroundTextureImporter.SetPlatformTextureSettings(platformSetting);
|
| | | AssetDatabase.ImportAsset(backGroundImporterPath);
|
| | | EditorUtility.SetDirty(backGroundTextureImporter);
|
| | | }
|
| | |
|
| | | var loginBackGroundFromPath = "Assets/Editor/Logo/" + _versionName + "/LoginBackGround.png";
|
| | | var loginBackGroundToPath = "Assets/Resources/UI/Sprites/LoginBackGround.png";
|
| | | AssetDatabase.DeleteAsset(loginBackGroundToPath);
|
| | | AssetDatabase.CopyAsset(loginBackGroundFromPath, loginBackGroundToPath);
|
| | |
|
| | | var loginBackGroundImporterPath = "Assets/Resources/UI/Sprites/LoginBackGround.png";
|
| | | var loginBackGrouindImporter = AssetImporter.GetAtPath(loginBackGroundImporterPath);
|
| | | var loginBackGroundTextureImporter = loginBackGrouindImporter as TextureImporter;
|
| | | if (loginBackGroundTextureImporter != null)
|
| | | {
|
| | | loginBackGroundTextureImporter.textureType = TextureImporterType.Sprite;
|
| | | loginBackGroundTextureImporter.spritePackingTag = string.Empty;
|
| | | loginBackGroundTextureImporter.assetBundleName = string.Empty;
|
| | |
|
| | | var platformSetting = new TextureImporterPlatformSettings();
|
| | | switch (buildTarget)
|
| | | {
|
| | | case BuildTargetGroup.Android:
|
| | | platformSetting.overridden = true;
|
| | | platformSetting.allowsAlphaSplitting = false;
|
| | | platformSetting.name = "Android";
|
| | | platformSetting.maxTextureSize = 1024;
|
| | | platformSetting.format = TextureImporterFormat.ETC2_RGB4;
|
| | | platformSetting.compressionQuality = 1;
|
| | | break;
|
| | | case BuildTargetGroup.iOS:
|
| | | platformSetting.overridden = true;
|
| | | platformSetting.allowsAlphaSplitting = false;
|
| | | platformSetting.name = "iOS";
|
| | | platformSetting.maxTextureSize = 1024;
|
| | | platformSetting.format = TextureImporterFormat.PVRTC_RGBA4;
|
| | | platformSetting.compressionQuality = 1;
|
| | | break;
|
| | | }
|
| | |
|
| | | loginBackGroundTextureImporter.SetPlatformTextureSettings(platformSetting);
|
| | | AssetDatabase.ImportAsset(loginBackGroundImporterPath);
|
| | | EditorUtility.SetDirty(loginBackGroundTextureImporter);
|
| | | }
|
| | | }
|
| | |
|