コード例 #1
0
ファイル: ConstantEditor.cs プロジェクト: edohe/grove
        public override void OnInspectorGUI()
        {
            Init();
            serializedObject.Update();

            using (new EditorGUI.DisabledScope(true))
            {
                EditorGUILayout.PropertyField(GetProperty("m_Script"), true);
            }

            var height   = m_Helper.GetHeight(GetProperty, s_Label);
            var position = EditorGUILayout.GetControlRect(false, height);

            if (m_Helper.DoGUI(GetProperty, position, s_Label))
            {
                serializedObject.ApplyModifiedProperties();
            }
        }
コード例 #2
0
ファイル: InputPropertyDrawer.cs プロジェクト: edohe/grove
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            Init(property);
            label = EditorGUI.BeginProperty(position, label, property);

            if (m_Helper.DoGUI(GetProperty, position, label))
            {
                property.serializedObject.ApplyModifiedProperties();

                if (Application.isPlaying)
                {
                    var input = property.GetObject() as InputBaseForEditor;
                    input.Change();
                }
            }

            EditorGUI.EndProperty();
        }