Hello guys! I am starting my unity development self-learning journey. Since I am a beginner I have many questions. I am using an EditorWindow to edit my game data, to load and save it.
if (gameData!=null)
{
SerializedObject serializedObject = new SerializedObject(this);
SerializedProperty serializedProperty = serializedObject.FindProperty("gameData");
EditorGUILayout.PropertyField(serializedProperty, true);
serializedObject.ApplyModifiedProperties();
if (GUILayout.Button("Save data"))
{
SaveGameData();
}
if (GUILayout.Button("Load data"))
{
LoadGameData();
}
Unfortunately, I can’t understand why in my editor window I just can manage attributes of my classes.
For example, if I have a class Question with this:
public AnswerOptionText[] Answers ;
→ The answers appear in my editor window.
public AnswerOptionText[] Answers { get; set; }
→ The answers doesn’t appear in my editor window.
I need to use class properties, is there any way to use it and manage it on my editor window?
If someone can help me I would be very grateful. Thanks.