Editor postproc script, files to XCode

This is for an iOS build.

So I have two files … aa.caf and bb.caf (they’re caf audio files - of course, this could apply to any files). (If you prefer, take “all the files in a folder.”)

Quite simply, when I build to XCode. I want a postprocessor that takes the two files aa.caf and bb.caf and puts them in XCode added to the target.

Note … as Graham explained HERE here you can do this by simply “doing it once by hand” and then “updating” the project folder.

the fact is I don’t want to do that. I want YOU ! to show me how you’d make a postprocessor script that does it.

1 Answer

1

// un-tested JS code
// Build a folder containing unity3d file and html file
import System.IO;
@MenuItem (“Build/Build-iOS-and-Copy”)
static function MyBuild(){
var levels : String = [“Assets/Scene1.unity”, “Assets/Scene2.unity”];
BuildPipeline.BuildPlayer( levels, “XCodeBuild”,
BuildTarget.iPhone, BuildOptions.None);
System.IO.Copy(“/blah/blah/aa.caf”, “XCodeBuild/wibble/wobble/aa.caf”);
System.IO.Copy(“/blah/blah/bb.caf”, “XCodeBuild/wibble/wobble/bb.caf”);
}

(Note that I don’t want/need the 50 bucks, and this is not a postprocessor script, this is a build pipeline script. Simply does the build, and then makes the copy. Adjust pathnames and scenes to suit.)

fascinating, let me experiment with that! lol on the 50 bucks !