Rather simple question I cannot for the life of me find the answer to. I am trying to make a button where you can hold down the button to sell multiple (for an in-game shop). I have found out that I should be using UnityEditor.UI.ButtonEditor to inherit from and I found this on this post here: Subclassing Button, public variable won't show up in the inspector - Questions & Answers - Unity Discussions. I have also checked the documentation and I cant figure out what is wrong.
I am aware there are 3 posts about this from 2017 on Unity Answers but the answer does not work for me. In case it would matter I am on version 2019.1.0f1.
using UnityEditor;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
[RequireComponent(typeof(Image))]
public class HeldButton : Button
{
[SerializeField] private UnityEvent _onHold;
}
#if UNITY_EDITOR
[CustomEditor(typeof(HeldButton))]
public class HelldButtonEditor : //WHAT GOES HERE
{
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
GUILayout.Label("string");
}
}
#endif