Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save GeorgiyRyaposov/b602860b7bb042079df4083e21560691 to your computer and use it in GitHub Desktop.
Save GeorgiyRyaposov/b602860b7bb042079df4083e21560691 to your computer and use it in GitHub Desktop.
#if UNITY_EDITOR
[UnityEditor.CustomEditor(typeof(YourScriptName))]
public class YourScriptNameEditor : UnityEditor.Editor
{
public override void OnInspectorGUI()
{
DrawDefaultInspector();
var yourScriptNameInstance = (YourScriptName)target;
if (GUILayout.Button("Button"))
{
yourScriptNameInstance.YourMethod();
}
}
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment