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

Code inside a Scene Asset Bundle

Discussion in 'Asset Bundles' started by nsmith1024, Oct 28, 2019.

  1. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    Hello,

    Im making a game where there are several scenes each with a completely different mini game, each scene is loaded from a remote server when the player changes scenes.

    At first, i had all the code and main assets (like vehicles, guns etc) that were used in any of the games in the main scene. Those assets would be instantiated when a particular scene is loaded on top of the main scene that needed those assets.

    The scene asset bundles would only contain static stuff like terrain trees and other props, but no code in them.

    Now im running into a big problem where the main scene is just way too big because it has to contain everything that would ever be used in any of the games. Since its a android game, the size is limited, and the play store only allows 100Meg apk, and im way past that already for the main scene so i cant submit the game to android play store unless i do something.

    The better way is to have the code to run each game inside the scene asset bundle itself, rather than trying to cram everything and game logic for every game into the main scene.

    Anybody knows if there is way to put code inside a scene asset and load it at run time from a remote server?

    Thanks