integration of Unity with cocos2d

Hi,
There are 2 projects one was made on Unity and other one on cocos2d . Can i integrate both one them? If yes then hw can i ??

No this is not possible

are you sure? Cant we do that through Xcode?

Unity does not offer any kind of source code for the engine, as such no you can’t integrate cocos (or any other engine) into unity nor vice versa.

also having 2 game engines in the same application makes no sense unless you wanted to ensure that you will not get below the 20mb border for iOS

Ok but what about plugins! Can we use them?

Actually one portion of the application is made on Unity and other portion on the cocos2d. Now the problem is with the integration?

You can use plugins yes and basically run Unity, or pause unity and run cocos, but you can not use the same assets in unity as in cocos and the build size will grow even further.

Question is why you would want to do that, either your game is 3d or 2D … if its 3D with a bit of 2D, using sprite manager sounds like a much better idea

yeah, you are right . Its a 3D game with 2D looks from appearence.

Actually earlier we decided to make the Game on the cocos2d but it was very much time taking so i started building its other portion on Unity. Now the both the portions are completed now . And now the problem is how to integrate them with each other?

Can u help me out with plugins? How to do this integration using plugins??

well “other portion” means something totally distinct right?
Cause you can’t overlay it and show both and alike.

and on how to do it: will be hard, you have to write corresponding code to get a view manager that runs and manages cocos fine and can be overlayed.
From the unity end you can then call c functions that show / hide this overlay etc

just be aware that the ram requirements you are going to have will require at least a 3GS, it won’t run on 3G / itouch 2nd gen anymore

I think that you may eventually make your life easier port your cocos2D onto unity …specially if you r game is 3D or let’s say 2.5D.
If you did one of his portion on unity already is this that hard to get back the cocos part into it ?

I doubt that having a game running from 2 different engine is a good idea…well this is just my opinion tho…:slight_smile:

ok fine. Can you explain or just give an example how to write code to get a view manager that runs cocos ?

You will have to ask on the cocos board about cocos stuff I fear