aot prebuilding, webgl, assetbundles

maxbaumgaertner 2 years ago updated by Juan Sebastian Uzumakii 1 year ago 4

i would like to load assets just before a new level is entered to minimize data-usage in webgl ,therefore i use assetbundles which i request just before the level change.
when using aot prebuild will it generate one big file that has to be loaded at the beginning? Or can i still have the macros in different assetbundles?
im not owning bolt yet, but i want to get this out of the way before purchasing.

thank you :-) 
Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):

Hi Max,

What AOT Pre-Build does is create a "fake" C# script file that calls all methods you use in your Bolt graphs. This prevents Unity from stripping the code thinking you wouldn't use it (because Bolt 1 uses reflection, which Unity can't detect).

The size of that file is minimal and shouldn't worry you for your build size. 

However, do note that you cannot load graphs in asset bundles that were not part of your initial build when you did the AOT Pre-Build. This is exactly like C#: you can't load scripts from asset bundles, because it's not supported on AOT platforms. Basically, in Unity, your logic / code cannot be part of bundles, it has to be part of the core build.

Is there any current way to execute a logic outside the central compilation?

Put the logic in an AssetBundle.

Hi Juan,

No unfortunately, that's not possible either in Bolt nor in traditional C# because of AOT platform restrictions.

if I do the "AOT Pre-Build" and then genre a compile.

Then he exported the "Prefab" of the "GameObject" with the "FlowGraph" inside it. And then genre the "AssetBundle"

Will the object work correctly?