Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

iOS and Mono Reflection Class

Discussion in 'Editor & General Support' started by ibrahimAlfors, Jul 3, 2014.

  1. ibrahimAlfors

    ibrahimAlfors

    Joined:
    Apr 21, 2014
    Posts:
    10
    I have been trying to solve this problem but I have nothing yet, there is a way to include scripts with asset bundles but they have to be pre-compiled, but that won't work for iOS (Manual says that) .. then how do I add precomipled scripts to asset bundles for iOS .. seems to be a very important feature to be left unresolved .. if anyone has a way around it please tell me

    Thanks
     
  2. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    The iOS TOC prohibits downloading executable code (precompiled or otherwise) outside of the main app itself. DLC is just supposed to be data, no code, so perhaps you don't want to go down this road at all?
     
    ibrahimAlfors likes this.
  3. ibrahimAlfors

    ibrahimAlfors

    Joined:
    Apr 21, 2014
    Posts:
    10
    Well, first thanks for replying to my post,

    I have read about that, its a very strict policy for apple but thats not the point here .. So no one has ever had a way to dynamically update a project after it has been produced .. without the actual updating of the whole project ..

    If I can't take that road, what road do you recommend I take if I want to dynamically add a new scene to my application without the need of updating the whole project?
     
  4. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Do you mean the project (i.e. Unity project) or the binary produced by it (ipa on iOS)? If you're asking about the latter, usually you'd have one Unity project for the base game plus all add ons. Some of the assets/scenes in that project will be included in the base game. Then you have a script that will make asset bundles using the remaining scenes/assets/whatever. You then put those asset bundles on a server somewhere, and download them to the client using the WWW class. Apple TOS aside, those asset bundles can (I think) include scripts.
     
  5. ibrahimAlfors

    ibrahimAlfors

    Joined:
    Apr 21, 2014
    Posts:
    10
    I'm sorry but I'm having a hard time understanding that approach.
    Yes I'm asking about if I have a project and its already running with some users and then I have to add a scene (that includes gameobjects and scripts) to it without the need to update the WHOLE application.

    Do you mean that I should separate my game objects from my scripts and create an asset bundle with the game objects? But then how would I include the scripts without producing an update for my applications? (because if I did, I would be adding updates every three days)
     
  6. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    After reading about this some more, it looks like there is no way to do code updates on iOS outside of an ipa update. It seems like a limitation intrinsic to the implementation of Unity/Mono on iOS, perhaps directly todo with Apple's "no downloading code" requirement.

    In general, if you want to update an iOS app as frequently as you would a web page, you'll want to look into more data driven designs where you can create variation without new code or, if you want to play really fast and loose, integrate a scripting language like Lua into Unity.
     
  7. ibrahimAlfors

    ibrahimAlfors

    Joined:
    Apr 21, 2014
    Posts:
    10
    Thanks for the reply, I also have read about the subject and asked some developers that worked on similar projects, the approach they used was that they defined the classes and uses of the application very well before starting the actual coding. By that, they were able to gather the common features that they are going to be in most future updates and created the scripts for that will serve these features in the project and included references to these scripts in the future asset bundles ... it seems to be the most successful and effective approach
     
  8. davidosullivan

    davidosullivan

    Joined:
    Jun 9, 2015
    Posts:
    387
    I'm interested in this too.

    I will have asset bundles that will need to include a sort of scene manager script that says, put these objects in these positions, play this music, wait a bit, play this animation etc etc. It will be pretty impossible for me to write a script that can go out with the initial app that can cover every possible eventuality for all the scenes I may add in the future- they are more like 'cut-scenes' than games...

    I'm just wondering if this solution would work?
    http://stackoverflow.com/questions/24740261/unity-c-sharp-precompile-and-mono-reflection

    Or maybe I can serialize like a save game state? (not that I really understand what that means)
    http://gamedevelopment.tutsplus.com...oad-your-players-progress-in-unity--cms-20934