private void DisplayProperty(string name, VariableProperty property) { GUILayout.BeginHorizontal(); GUILayout.Label(name); switch (property.PropertyType) { case VariableProperty.Type.Boolean: property.Set(GUILayout.Toggle(property.GetBoolean(), GUIContent.none)); break; case VariableProperty.Type.Number: property.Set(EditorGUILayout.DoubleField(property.GetNumber())); break; case VariableProperty.Type.String: property.Set(GUILayout.TextField(property.GetString())); break; case VariableProperty.Type.Object: property.Set(EditorGUILayout.ObjectField(property.GetObject(), property.GetObjectType(), true)); break; case VariableProperty.Type.Vector: property.Set(EditorGUILayout.Vector2Field("", property.GetVector())); break; } GUILayout.EndHorizontal(); }