vrchat-community / UdonSharp

A compiler for compiling C# to Udon assembly
https://udonsharp.docs.vrchat.com
MIT License
461 stars 50 forks source link

Nested DataDictionary inside a DataList are prone to crash when reloading script assemblies (Compiling/Going into Playmode) #160

Open KyrowoVRC opened 3 months ago

KyrowoVRC commented 3 months ago

Describe the bug in detail: I'm declaring a DataList and it's first and only entry is a DataDictionary. Whenever I go into playmode or compile it's prone to crashing. It crashes unity around 90% of the time.

Provide steps/code to reproduce the bug: New Project with VRChat SDK - Worlds 3.5.2 My code snippet:

    private DataList _playerlist = new DataList() {
        new DataDictionary()
            {
                {"Name", "PlayerDefaultName"},
                {"Lives",3},
                {"Score",0}
            }
    };

Expected behavior: Not crash unity most of the time and compile properly.

Additional Information: crash.dmp Editor.log

xantoz-vrc commented 6 days ago

I'm seeing this too.

I had to change over to using JSON TextAssets for my project which is a lot less convenient than writing the data inline, no compile-time syntax checking, doesn't let me use consts declared in the code, nor insert any type boxable by DataToken; all numbers become Doubles and no ability to insert Objects.