サンプルソースだと、EnumHogeのZeroに相当する部分がなかった!!!
また、その状態でも実行できちゃった。
そんなこんなで、何もないnullなメンバーが出来ちゃった・・・///
Zeroに相当する部分がないとスクリプト当てただけじゃ以下みたいな表示に・・・///
Zeroに相当する部分があると、スクリプト当てただけで以下のような感じ
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
using UnityEngine; using System.Collections; public class TestEnumPopup : MonoBehaviour { //ビットマスクになる様にenumを定義 public enum EnumHoge { //zeroが規定値になる zero = 0, one = 1, two = 2, four = 4, eight = 8, } public EnumHoge test; // Use this for initialization void Start () { } // Update is called once per frame void Update () { } } |
1 2 3 4 5 6 7 8 9 10 11 12 |
using UnityEngine; using System.Collections; using UnityEditor; [CustomEditor(typeof(TestEnumPopup))] public class TestCustomEditorEnumPopup : Editor { public override void OnInspectorGUI() { TestEnumPopup obj = target as TestEnumPopup; obj.test = (TestEnumPopup.EnumHoge)EditorGUILayout.EnumPopup("test", obj.test); } } |
コメント
No Trackbacks.