Editing in Xcode after publishing from Unity

Hi. Does anyone know if it is possible to edit the Xcode project published from the Unity iPhone project and then recompile directly? You probably can, but I just wanted to know if anyone has tried.

just build the project instead of build and run

thats no problem

but you don’t have any engine sources or alike

Thanks. Does that mean editing the source code from Unity is a no-go. IE I can’t access any compiled Unity objects to add code in Objective-C in XCode?

Unity’s objective-c++ code creates a window, creates an EAGLView (like the Apple sample code for the lander game), and calls into the Unity engine via c function calls. There’s not much going on inside the visible obj-c code, and there’s no exposed means for calling between the engine and your obj-c code. You do have an opportunity to do some things before the engine initializes. (i.e. In the Enhancement Pack I shown a second splash screen before the engine initializes, although to do that I took all of the engine code out of applicationDidFinishLaunching:) All of this happens in AppController.mm.

If you do make edits to it, be aware that Unity will write over it the next time you build!

Right, unity does not offer you any source code to the technology.
You only have access to the application execution layer that starts unity

Oh - alright. Thanks a whole bunch guys. So in effect, that means that I can build “regular” stuff in the Interface Builder and XCode, and then when I’m ready, call the Unity stuff to initialize it? IE I can enter and exit the Unity interface, and that’s about it. Let me know if I’ve got it all wrong. :roll:

One other thing to keep in mind is, should you decide to automatize the copying of your own files on project building, you will be faced with a small challenge, which is the addition of your files to the actual XCode project.

I’m close to having it work using some Applescript, but haven’t really succeeded yet.
I’ll post the final script if I ever get it working before moving on to some other task.

@bliprob: Have you been able to “Add to Project” automatically?

It’s a little more complicated than that. You can delay the initialization of the engine, do some stuff, and initialize the engine later. So yeah, you can make views in IB, display them first (for a pre-game interface) and then fire up the engine later. Remember the engine initialization takes a while.