Skip to content

Instantly share code, notes, and snippets.

@vicenterusso
Created September 18, 2015 00:29
Show Gist options
  • Save vicenterusso/bbf7a025d5695840b93f to your computer and use it in GitHub Desktop.
Save vicenterusso/bbf7a025d5695840b93f to your computer and use it in GitHub Desktop.
Generic boilerplate for custom inspector
using System;
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(MyScript))]
public class MyScriptEditor : Editor
{
private MyScript _script;
void OnEnable()
{
_script = (MyScript)target;
}
public override void OnInspectorGUI()
{
//DrawDefaultInspector();
if (GUI.changed)
{
EditorUtility.SetDirty(_script);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment