Reputation: 12230
I have an iOS plugin for unity3d with a static library inside, this library uses some images from .bundle. However I cannot figure out how to include my bundle to Unity Package. When I put my bundle to the package and try to build a project from Unity3d Editor, in the end I don't have my bundle included in generated XCode project.
So I have two questions:
1) Is there any way to get it copied to generated project?
2) Is it possible to specify extra frameworks from within unity3d plugin (I have a dependency to AdSupport.framework) to be included in generated project as well.
Update: you can copy your bundle to Assets/WebPlayerTemplates so Unity3d doesn't import anything from there, this directory also gets exported to unitypackage. The final step is to use postbuild scripts to include your bundle to generated Xcode project, I used XUPorter for this.
Upvotes: 2
Views: 5138
Reputation: 715
Actually, there is a way. Not sure if this is added after your answers/comments but;
Upvotes: 1
Reputation: 12230
I discovered there is no way to configure Unity3d in such a way that it includes extra frameworks and bundles to generated Xcode project (i.e. Marmalade SDK allows you to do so via configuration), I use mod_pbxproj and Unity3d console tool to generate XCode project and inject all necessary bundles and frameworks to the project upon build completion.
There's a better option, see question itself.
Upvotes: 1
Reputation: 13146
Unity copies every file from folder Assets/Plugins/iOS to the Xcode project's Library folder. That's perfect for your lib file and other stuff but it fails when it commes to directory structures. Resource bundles are directories and thus Unity just copies the .meta file of the directory and refuses to copy the files inside.
A workaround for this is to copy your bundle manually and import them into Xcode (menu File / Add File to "Unity-iPhone"). Afterwards you should always export your iOS project in Append mode (CMD+B does this by default). There are two drawbacks:
Upvotes: 2