一个编译时自动替换Icon.png 和 Default.png 的脚本
1.创建一个名为PostprocessBuildPlayer(无后缀)文件在”AssetsEditor”目录下,如果没有Editor文件夹就建立一个.
2.将下面到代码粘贴到新建到文件中并保存
3.将图标和启动画面文件复制到你项目到根目录中.也就是包含Assets文件夹到那个目录.Icon.png是图标,Default.png是启动画面.
4.如果你是Unity iPhone基础版,不能替换启动画面(Default.png),那就将脚本到最后3行用#注释掉.
脚本代码:
#!/usr/bin/perl
use File::Copy;
my $installPath = $ARGV[0];
#copy Default.png and Icon.png from Asset to installPath
my $iconFilename = "Icon.png";
my $defaultFilename = "Default.png";
# The type of player built:
# "dashboard", "standaloneWin32", "standaloneOSXIntel", "standaloneOSXPPC", "standaloneOSXUniversal", "webplayer", "iPhone"
my $target = $ARGV[1];
print ("
*** PostprocessBuildPlayer - Building at '$installPath' with target: $target ***
");
my $dst = $installPath . "/" . $iconFilename;
print ("Copying Icon.png [$iconFilename -> $dst
");
copy($iconFilename, $dst) or die "Icon file can not be copied ";
my $dst = $installPath . "/" . $defaultFilename;
print ("Copying Default.png [$defaultFilename -> $dst]
");
copy($defaultFilename, $dst) or die "Default file can not be copied ";
原帖:http://forum.unity3d.com/viewtopic.php?t=17373,由威阿翻译,转载请注明.