Hey all! I'm currently trying to make a dialogue system using visual scripting nodes for structure. I'm trying to create a custom data type with a custom inspector/drawer for my node but none of the approaches I've tried have worked.
I've tried the drawer method like how the manual says but all i get is what you see in the screenshot.
I've also tried making an inspector but that also has not worked. Any help would be great thanks!
Here's my drawer attempt:
using UnityEngine;
using UnityEditor;
[CustomPropertyDrawer(typeof(Dialogue))]
public class DialogueDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
EditorGUI.BeginProperty(position, label, property);
position = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label);
var indent = EditorGUI.indentLevel;
EditorGUI.indentLevel = 0;
var textRect = new Rect(position.x, position.y, position.width, position.height);
EditorGUI.PropertyField(textRect, property.FindPropertyRelative("text"), GUIContent.none);
EditorGUI.indentLevel = indent;
EditorGUI.EndProperty();
}
}