Expand Unity apps with UIKit

Hi All

Question of the day: can i just use Unity to make the 3d part of the game (to avoid to deal with OGL), and implement the logic and the UI via UIKit on a different UIview?

I am asking since I am planning to write an app heavily based on my existing OBJ-c code; and in an attack of lazyness, is easier to port the graphic using Unity, instead than writing the OGL part for the graphic, and re-use the code already written.

You could say “why don’t you write it all in Unity”; and the answer is just that i am more comfortable to have code written in obj-c instead than using scripting in Unity (for the majority of the time i prefer C#, but this is a phone only project, and other people on the team do not wanna spend time with Unity).

So i am concerned if there is an easy way to create a project with unity and build it; and then go from there; keeping the obj-c code and the graphical implementation separated (like view-viewcontroller-model; to be nice with the Apple guidelines for the store submission).

So to summarize:

-put models, make animations, make scripts for behaviors, particle effects and so on in unity

-build and tweak the Unity project in Xcode to add the UI using UIKit, and use classes made in OBJ-c to interact with the game

Any suggestion is welcome, since would be something more than what i know now :smile:

That will be hard to impossible actually.

Unity is not some kind of view that you just hook in and are happy. Its also no “ogl part”, its a complete selfcontained environment, the xcode part is only to setup the application handler and tell it to run, the rest happens within the engine

You can call out to the objc side and overlay views, thats no problem though. But going the otherway round or thinking of having a tight bidirectional communication will require quite some work that will not needfully work.

that’s a hit…i was hoping that the engine would run like an engine on pc; where you have your nice view and you can overlay another view , set the alpha and add the rest of the UI on top of it :frowning:

Guess that gotta switch approach for this project to a pure OGL app then :frowning:

Having support for Unity running in a view would be nice thou (hint hint *wink *wink); i can run Irrlicht in a view, so was hoping to do the same with Unity

Thanks Dreamora

You can, I have UIKit working perfectly over the top of Unity’s rendering window. When I say perfectly it works fine now, however there was a long road to get there. Unity has not made it easy to do, and seeing as their GUI system brings these devices to a grinding halt, I don’t understand why they didn’t take full advantage of the iPhone’s UIKit framework on the iPhone.

I will say I don’t rely on Unity->Objective C communication every frame, just for a messenger system for general menu elements.

Any Examples? Does this require Unity pro?

In unity iphone 1.x, yes it reasonable requires unity iphone pro (which requires unity pro to buy at all)

with unity iphone 3, both iphone liceses can be expanded through native C functions.

I tried some quick attempts, and the results were not as expected…maybe an example would be useful :slight_smile:

If is too much to ask then i will continue with the OGL approach, putting Unity aside.

Guess that i gotta write a post in the whislist for U4 :slight_smile: but probably the objective is to keep Unity and Xcode separated (marketing purposes? who knows, is none of my business after all)

has nothing to do with seperate but unity is a self contained engine, you can’t hook it in or alike.
you start it, pause it and end it, thats basically it.

Unity also has no UI Kit support and will never have.

What you are looking to do is not hard but you need to know your way with UIKit and you must read the advanced iphone docs on Plugins :slight_smile:

that or buy the enhancement pack to have a collection of samples (that was one if not my primary reason to buy it originally to have something to learn from and expand upon. by now I know a hell a lot more about uikit and developing native applications straight in xcode etc naturally but it was a great start)

@Dreamora you answer my questions everywhere, I think I will just email them to you directly :wink:

When do we get beta of Unity 3, or is that also only for Unity Pro users?

I really find it diffucult to understand why I need Unity3D Pro in order to buy Unity iPhone Pro. Are they connected?

There is no beta of unity 3 unless you preorder unity 3 pro / unity android 3 pro / unity iphone 3 / unity iphone 3 pro

users of the free unity 3 must wait until it is released.

Breaking down:

Unity: the core

Unity iphone: the extra add on that let you compile iOS apps using xcode and iPhone SDK

When you get the indie you use the indie version of unity; but if you wanna go pro, you need the pro license of unity, since the pro version of the unity iphone is an add-on

Kinda like when you buy a game and they come up with an expansion that requires the original to work…same concept :wink:

Isn’t the release date close now? Summer is almost gone :wink:

and now that you mention it…with U3 means that i gotta upgrade my U2 iphone license to U3 iphone? I hope that we will get some upgrade price :slight_smile:

Summer means nothing. Last year summer was at Unite 2009 … can’t recall when that was exactly, somewhen late sept early oct though so that should give you an idea.
I don’t expect it till sept if not oct as a release with the current version would lead to a lot of pressure on UT to bring out 3.0.1 optimally the very same day as there are some issues right now that at least prevent me from using it for production use.

And yes if you bought Unity iPhone 1.x earlier than march or so when preorder started you need to upgrade.

iPhone basic to unity iphone 3 is $100 now, $150 after release.

iPhone Advanced to unity iphone 3 pro is $500 now, $750 after release (and as with iphone advanced it means that you naturally must own unity 3 pro for desktop too, which is also $500 now, $750 after release. you can enter your U2-xxxx license on the store to see the costs etc)

Wow, the prices are really different from when i bought Unity2 :slight_smile: at that time was 200 dollars for the indie version (now free) and 300 for the iphone indie ; and the pro version was 1500 :slight_smile:

Guess that soon i will also get the pro version :smile:

BTW where do i get the link for the beta of U3? I’ve upgraded the iphone version right now

Sorry for the OT :slight_smile:

Hey I just got the beta. It said as a pre order customer I get the beta. Weird and cool. It came in an email.

it will take some days++ to get the mail with the link. unsure how long it is now as it gets shorter and shorter, originally it was in the weeks range :slight_smile:

Hw come, i’ve purchased it and you didn’t and you have got the email with the beta before me? :slight_smile:

if he got the mail he bought it otherwise he would not get one

From his question about Unity pro I would assume that he is a new user that has not even got Unity yet ; maybe i am wrong :slight_smile:

I have unity for iPhone. I guess Unity junior. I can see now why they charge for Unity and Unity iPhone since they are now integrated.

Yes I am a new unity user. I have a U3 serial. Apparently if you have a U# serial you are on the list.