I am having trouble with List and the PropertyField on my custom editor inspector, I am using the following code which displays the list but i am unable to access it from the inspector in the unity editor, it is greyed out.
[System.Serializable]
public class Window
{
[SerializeField] public float Win_Width;
[SerializeField] public float Win_Height;
[SerializeField] public float Win_Depth;
[SerializeField] public float Win_FrameSize;
[SerializeField] public int HS;
[SerializeField] public int WS;
[SerializeField] public bool MultiSectionWidnow;
[SerializeField] public Material GlassMaterial;
[SerializeField] public GameObject Parent;
}
[CustomEditor(typeof(CreateWallScript), true)]
public class CreateWallEditor : Editor
{
GameObject Parent;
public List<Window> Win = new List<Window>();
public override void OnInspectorGUI()
{
CreateWallScript CW = (CreateWallScript)target;
ScriptableObject t = this;
SerializedObject so = new SerializedObject(t);
SerializedProperty stringsProperty = so.FindProperty("Win");
so.Update();
EditorGUILayout.PropertyField(stringsProperty,new GUIContent("Window Setup:"), true);
so.ApplyModifiedProperties();
Parent = CW.gameObject;
if (GUILayout.Button("Create"))
{
CW.Clear();
CW.Create(Parent, 3, 5, 0.1f, false, false, 0);
}
}
}
This is what is displayed,