Describe the bug
When using CreatePropertyGUI() for custom PropertyDrawers, a No GUI Implemented error is displayed.
Expected behavior
A custom PropertyDrawer should be displayed.
Code Sample
using UnityEngine;
public enum IngredientUnit { Spoon, Cup, Bowl, Piece }
// Custom serializable class
[Serializable]
public class Ingredient
{
public string name;
public int amount = 1;
public IngredientUnit unit;
}
public class Recipe : MonoBehaviour
{
public Ingredient potionResult;
public Ingredient[] potionIngredients;
}
[CustomPropertyDrawer(typeof(Ingredient))]
public class IngredientDrawerUIE : PropertyDrawer
{
public override VisualElement CreatePropertyGUI(SerializedProperty property)
{
// Create property container element.
var container = new VisualElement();
// Create property fields.
var amountField = new PropertyField(property.FindPropertyRelative("amount"));
var unitField = new PropertyField(property.FindPropertyRelative("unit"));
var nameField = new PropertyField(property.FindPropertyRelative("name"), "Fancy Name");
// Add fields to the container.
container.Add(amountField);
container.Add(unitField);
container.Add(nameField);
return container;
}
}
Screenshots
Desktop: Windows 11
Unity version: 2022.3.4
Tri Inspector version: 1.9.6
Describe the bug When using CreatePropertyGUI() for custom PropertyDrawers, a No GUI Implemented error is displayed.
Expected behavior A custom PropertyDrawer should be displayed.
Code Sample
Screenshots
Desktop: Windows 11 Unity version: 2022.3.4 Tri Inspector version: 1.9.6