AOT Generation doesn't find Dictionary<int,float>

Issue #428 resolved
David Hackbarth created an issue

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)

  1. Tor Esa Vestergaard

    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.

    1. What happened?
    2. How can we reproduce it?
    3. If screenshots would help explain or demonstrate your issue, please include these.
    4. What version of Unity are you using?
    5. What version of Odin are you using? (See "Tools > Odin Inspector > About")
    6. Do you have Editor Only mode enabled?
    7. What operating system are you on?

    When attaching ZIP files then please remember to remove Odin from the archive.

  2. David Hackbarth 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.

  3. Tor Esa Vestergaard

    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.

  4. Tor Esa Vestergaard

    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.

  5. David Hackbarth 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?

  6. Tor Esa Vestergaard

    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.

  7. Lucas Schwaner

    This should almost certainly be fixed in the newer versions of Odin, reopen this issue if the problem is still present.

  8. Log in to comment