I thought this worked, but it doesn’t seem to be doing so…
Say I have a class:
[System.Serializable]
public class MyClass
{
public string thisString = "My Default Text";
public Color defaultColor = Color.white;
public bool myBoolean = true;
public Vector3 myVector3 = new Vector3 (1.0f, -1.0f, 2.0f);
}
And I have a built-in array:
public class MyMainScript : MonoBehaviour {
public MyClass[] myClasses;
}
I want to populate this array in the inspector, but I would like the defaults from the class MyClass to be set as defaults in the array. Currently they are not. Is there a way to have the defaults in the original class definition appear in the built-in array when elements are added?