I wrote a code similar to this:
using System.Collections.Generic;
using UnityEngine;
using System;
[Serializable]
public class class1 {
[Serializable]
public class class2 {
public int intParamter;
public string stringParameter;
}
public List<class1> class1s;
public List<class2> class2s;
}
public class test : MonoBehaviour {
public List<class1> class1s = new List<class1>();
}
But the inspector is overlapping.
Is there something wrong with the code or is this just a bug?
Note: using Unity 2021.2.0a10.1508 with HDRP if that matters.
That didn’t use to happen before it just suddenly occurred without any changes to the original script.
EDIT: sorry small typo in the code.
using System.Collections.Generic;
using UnityEngine;
using System;
[Serializable]
public class class1 {
[Serializable]
public class class2 {
public int intParamter;
public string stringParameter;
}
public List<class2> class2sA;
public List<class2> class2sB;
}
public class test : MonoBehaviour {
public List<class1> class1s = new List<class1>();
}
Still the same problem. I just wanted to correct it before someone says that every element of “class1” has a list of “class1” which contains an element of “class1”… and so on, so the problem is caused by exceeding the serialization depth limit. which is not the case. I think.