| | |
| | | { |
| | | public static void SetLaunchBackGround(string publisher, BuildTarget buildTarget) |
| | | { |
| | | var fromPath = "Assets/Editor/Logo/" + GetVersionName(publisher) + "/Launch.png"; |
| | | var toPath = "Assets/ResourcesOut/BuiltIn/UI/Sprites/Launch.png"; |
| | | var fileNames = new List<string>() { "Launch_1.png", "Launch_2.png", "Launch_3.png" }; |
| | | |
| | | AssetDatabase.DeleteAsset(toPath); |
| | | AssetDatabase.CopyAsset(fromPath, toPath); |
| | | |
| | | var importerPath = "Assets/ResourcesOut/BuiltIn/UI/Sprites/Launch.png"; |
| | | var importer = AssetImporter.GetAtPath(importerPath); |
| | | var textureImporter = importer as TextureImporter; |
| | | if (textureImporter != null) |
| | | for (var i = 0; i < fileNames.Count; i++) |
| | | { |
| | | textureImporter.textureType = TextureImporterType.Sprite; |
| | | textureImporter.spritePackingTag = string.Empty; |
| | | textureImporter.assetBundleName = "builtin/sprite"; |
| | | var fileName = fileNames[i]; |
| | | var fromPath = "Assets/Editor/Logo/" + GetVersionName(publisher) + "/" + fileName; |
| | | var toPath = "Assets/ResourcesOut/BuiltIn/UI/Sprites/" + fileName; |
| | | |
| | | var platformSetting = new TextureImporterPlatformSettings(); |
| | | switch (buildTarget) |
| | | AssetDatabase.DeleteAsset(toPath); |
| | | AssetDatabase.CopyAsset(fromPath, toPath); |
| | | |
| | | var importerPath = toPath; |
| | | var importer = AssetImporter.GetAtPath(importerPath); |
| | | var textureImporter = importer as TextureImporter; |
| | | if (textureImporter != null) |
| | | { |
| | | case BuildTarget.Android: |
| | | platformSetting.overridden = true; |
| | | platformSetting.allowsAlphaSplitting = false; |
| | | platformSetting.name = "Android"; |
| | | platformSetting.maxTextureSize = 1024; |
| | | platformSetting.format = TextureImporterFormat.ETC2_RGB4; |
| | | platformSetting.compressionQuality = 1; |
| | | break; |
| | | case BuildTarget.iOS: |
| | | platformSetting.overridden = true; |
| | | platformSetting.allowsAlphaSplitting = false; |
| | | platformSetting.name = "iOS"; |
| | | platformSetting.maxTextureSize = 1024; |
| | | platformSetting.format = TextureImporterFormat.PVRTC_RGB4; |
| | | platformSetting.compressionQuality = 1; |
| | | break; |
| | | textureImporter.textureType = TextureImporterType.Sprite; |
| | | textureImporter.spritePackingTag = string.Empty; |
| | | textureImporter.assetBundleName = "builtin/sprite"; |
| | | |
| | | var platformSetting = new TextureImporterPlatformSettings(); |
| | | switch (buildTarget) |
| | | { |
| | | case BuildTarget.Android: |
| | | platformSetting.overridden = true; |
| | | platformSetting.allowsAlphaSplitting = false; |
| | | platformSetting.name = "Android"; |
| | | platformSetting.maxTextureSize = 1024; |
| | | platformSetting.format = TextureImporterFormat.ETC2_RGB4; |
| | | platformSetting.compressionQuality = 1; |
| | | break; |
| | | case BuildTarget.iOS: |
| | | platformSetting.overridden = true; |
| | | platformSetting.allowsAlphaSplitting = false; |
| | | platformSetting.name = "iOS"; |
| | | platformSetting.maxTextureSize = 1024; |
| | | platformSetting.format = TextureImporterFormat.PVRTC_RGB4; |
| | | platformSetting.compressionQuality = 1; |
| | | break; |
| | | } |
| | | |
| | | textureImporter.SetPlatformTextureSettings(platformSetting); |
| | | AssetDatabase.ImportAsset(importerPath); |
| | | EditorUtility.SetDirty(textureImporter); |
| | | } |
| | | |
| | | textureImporter.SetPlatformTextureSettings(platformSetting); |
| | | AssetDatabase.ImportAsset(importerPath); |
| | | EditorUtility.SetDirty(textureImporter); |
| | | } |
| | | |
| | | } |
| | | |
| | | public static void SetLoginBackGround(string publisher, BuildTarget buildTarget) |