Benutzerdefinierte Redakteur Einheit
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(MyComponent))]
[CanEditMultipleObjects]
public class MyComponentEditor : Editor
{
public override void OnInspectorGUI()
{
MyComponent myComponent = (MyComponent)target;
DrawDefaultInspector();
if(GUILayout.Button("MyButton"))
{
myComponent.doSomething();
}
}
}
MunchDuster