unity-domain-reload-helper icon indicating copy to clipboard operation
unity-domain-reload-helper copied to clipboard

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

Open laurentopia opened this issue 3 years ago • 1 comments

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

laurentopia avatar Oct 30 '22 01:10 laurentopia

Can it be avoided by declaring initialization in constructor?

Watcher3056 avatar Feb 18 '23 09:02 Watcher3056