AOT Generation doesn't find Dictionary<int,float>
Hi,
after scanning my project for AOT generation it doesn't find Dictionary<int, float> and also no System.float. After manual inserting System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib], [System.Single, mscorlib]], mscorlib and System.Single, mscorlib, it recognize it.
There is another bug. I can't change most entries manual by clicking on it. I have to edit the asset with a text editor.
I'm using Unity 2018.1.8 with Odin 2.0.5.
Best regards, David
Comments (12)
-
-
reporter -
reporter - attached LevelData.cs
-
reporter I'm on Mac OS X 10.13.6.
First issue: I attached you a cs file. Please insert in a project and do a scan.
Second issue: I attached you a screenshot. You see that I can edit the first line, but when I click the second I don't get this edit field.
-
There is no Unity asset in the provided code example, and that means there is nothing that can be scanned. The AOT scan scans the following: all scenes included in the build, all assets referenced by those scenes (and the assets referenced by those assets, and so on), and all assets that are in Resources.
-
Your second reported issue with being unable to edit anything but the first entry reproduces, though - thanks for the report on that! I'll be looking into it.
-
reporter Okay. So if I reference an instance of LevelData in a ScriptableObject and have a reference in a scene to this ScriptableObject, the AOT scan should find the types, shouldn't it?
-
Yes, that's correct.
-
reporter - attached LevelDataTest.unitypackage
Hopefully, I attached a good example with all necessary items.
-
I should add, it will find the data that's actually there during the scan. This is not a reflection-based scan - what we do is manually call serialize on everything that might be relevant, and then the serializer keeps track of which types are being serialized, and these encountered types are what actually make it into the list.
I should also note that the default AOT scan is just a few lines of code of us using our AOT support utilities. You can look in the BuildAOTAutomation.cs script for the basic approach, and use AOTSupportScanner and AOTSupportUtilities to build your own custom scan logic and manually mess with the list of types to generate support for before generating a support DLL from that list.
-
reporter Okay, thanks for your help. :)
-
- changed status to resolved
This should almost certainly be fixed in the newer versions of Odin, reopen this issue if the problem is still present.
- Log in to comment
Can you give me some reproduction steps, or a reproduction project/package that reproduces the scan not finding your Dictionary? As for the second issue, can you clarify what exactly you mean?
Before we get more information, I'm afraid we can't act on the issue. Please use the list of questions that is displayed when you are creating the issue.
When attaching ZIP files then please remember to remove Odin from the archive.