joshcamas / unity-domain-reload-helper

A couple of attributes that help disabling Domain Reloading in Unity easier
MIT License
185 stars 11 forks source link

[BUG] [ClearOnReload] static List<MonoBehaviour> list = new() turns into null #11

Open laurentopia opened 1 year ago

laurentopia commented 1 year ago

I think that [ClearOnReload] nulls out a list that was created as part of its declaration. repro: [ClearOnReload] static List thisList = new(); void Update() { Debug.Log(thisList.Count()); } returns nullref

Watcher3056 commented 1 year ago

Can it be avoided by declaring initialization in constructor?