Unity编译到Xcode自动添加AppIcon

来源:互联网 发布:淘宝刷关注软件 编辑:程序博客网 时间:2024/05/17 04:07

1、将要添加的所有Icon放到指定目录:


2、拷贝Icon的方法:

<span style="font-size:14px;">public static void CopyIcons(string pathToBuiltProject){string appIconPath = Application.dataPath + "/Editor/XUPorter/AppIcon/";string[] iconflies = null;if (Directory.Exists(appIconPath)){iconflies = Directory.GetFiles(appIconPath);}if (iconflies != null && iconflies.Length > 0){appIconPath = pathToBuiltProject + "/Unity-iPhone/Images.xcassets/AppIcon.appiconset/";string[] icons = Directory.GetFiles(appIconPath);foreach (string file in icons){Debug.Log("Delete icon:" + file);File.Delete(file);}foreach (string file in iconflies){string fileName = file.Substring(file.LastIndexOf("/") + 1);if (fileName.EndsWith(".png") || fileName.EndsWith(".json")){Debug.Log("Icon Name:" + fileName);File.Copy(file, Path.Combine(appIconPath, fileName));}}}}</span>


0 0
原创粉丝点击