Created
April 25, 2015 06:20
-
-
Save suakig/6ffc53377b8abcb2a0d4 to your computer and use it in GitHub Desktop.
EquipmentEditor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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