Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

integration of Unity with cocos2d

Discussion in 'Scripting' started by saurabh, Nov 20, 2010.

  1. saurabh

    saurabh

    Joined:
    Sep 9, 2010
    Posts:
    70
    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 ??
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    No this is not possible
     
  3. saurabh

    saurabh

    Joined:
    Sep 9, 2010
    Posts:
    70
    are you sure? Cant we do that through Xcode?
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    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
     
  5. saurabh

    saurabh

    Joined:
    Sep 9, 2010
    Posts:
    70
    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?
     
  6. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    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
     
  7. saurabh

    saurabh

    Joined:
    Sep 9, 2010
    Posts:
    70
    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??
     
  8. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    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
     
  9. giyomu

    giyomu

    Joined:
    Oct 6, 2008
    Posts:
    1,094
    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..:)
     
  10. saurabh

    saurabh

    Joined:
    Sep 9, 2010
    Posts:
    70
    ok fine. Can you explain or just give an example how to write code to get a view manager that runs cocos ?
     
  11. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    You will have to ask on the cocos board about cocos stuff I fear