Skip to content

Instantly share code, notes, and snippets.

@suakig
Created April 25, 2015 06:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suakig/6ffc53377b8abcb2a0d4 to your computer and use it in GitHub Desktop.
Save suakig/6ffc53377b8abcb2a0d4 to your computer and use it in GitHub Desktop.
EquipmentEditor.cs
using UnityEngine;
using System.Collections;
using UnityEditor;
[CustomEditor(typeof(Mask))]
public class EquipmentEditor : Editor {
public override void OnInspectorGUI()
{
var obj = target as Mask;
obj.id = (Mask.ID)EditorGUILayout.EnumMaskField ("MaskIDField", obj.id);
//GUI.changedをチェックすることで、いずれかの値が変更された場合、EditorUtility.SetDirty コードが実行されます。
if (GUI.changed) EditorUtility.SetDirty(target);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment