Reply To: AOT in a On-Demand Resources game using AssetBundle

FlowCanvas Forums Support AOT in a On-Demand Resources game using AssetBundle Reply To: AOT in a On-Demand Resources game using AssetBundle



Thank you for your positive feedback and the detailed post!
I think that the best approach around this, would be to provide an extra c# AOTClasses file along with each bundle that would contain all generated AOT classes for the graphs in that bundle. Does including an extra c# file with the bundle is possible for you?
With that said, right now creating multiple AOTClasses.cs files and having them all together is not really easy since one overwrites the other and they both use the same class name, but I could of course make a few changes, so that this could be done a bit easier, by each generated file, having it’s own class name so that there be no conflicts between one another.
With that done, you would then need to generate a different AOTClasses file for each different graph and bundle it in the Asset Bundle. Would that work?

To answer your questions:

1. Adding the whole UnityEngine namespace would create some problems both in the editor as well as in the generation due to the complexity of all the types that are included in the UnityEngine namespace (which I would gladly look after fixing and doing so right now), but even so, it would take a hell lot of a time to compile due to the amount of classes and methods generated. So, I wouldn’t really recommend adding every thing :/

2. As you foresee, the types added in the list, would interfere with the editor usage, by having all of them show (as well as make the editor slower to respond in certain cases. One solution around this, like you said, would be to create and use different type list presets in the Preferred Types editor, one being for “working” in the editor, and another for the actual AOTClasses file “generation”. That is definitely a valid workflow.

3. There is no way I know of and this is really something I wish it could be done myself and would have been a true time save if possible. I have searched everywhere for this but to no avail :-/

4. Regarding the problem and just to confirm, is this error log WITH the generated AOTClasses file that is on the GITHUB link? I suppose it is, but it doesn’t seem right for the error to throw since RaycastHit does exist in the generated files. Hmm. I will take a look at this tomorrow and try to reproduce this, just in case I’ve missed something and let you know as soon as possible. If I can get a hand on the repository just for the shake of testing the same project, that would of course also be great.

Please, also let me know regarding my first suggestion above, about using a separate AOTClasses generated file for each graph, bundled with the graph in the Asset Bundle, and whether or not that would be a valid solution/workflow for you.


Join us on Discord: