InspectorButton
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(YourClassName))]
public class YourClassNameEditor : Editor
{
public override void OnInspectorGUI()
{
YourClassName yourClassName = (YourClassName)target;
if (GUILayout.Button("SayHi"))
{
yourClassName.SayHi();
}
}
}
Comments
Post a Comment