Пример #1
0
        public virtual bool OnInspectorNUI()
        {
            if (drawer == null)
            {
                drawer = new NUIDrawer();
            }

            drawer.BeginEditor(serializedObject);
            if (!drawer.Header(serializedObject.targetObject.GetType().Name))
            {
                drawer.EndEditor();
                return(false);
            }

            return(true);
        }
Пример #2
0
        public virtual bool OnNUI(Rect position, SerializedProperty property, GUIContent label)
        {
            if (drawer == null)
            {
                drawer = new NUIDrawer();
            }

            drawer.BeginProperty(position, property, label);

            string name = property.FindPropertyRelative("name")?.stringValue;

            if (string.IsNullOrEmpty(name))
            {
                name = property.displayName;
            }

            if (!drawer.Header(name))
            {
                drawer.EndProperty();
                return(false);
            }

            return(true);
        }
Пример #3
0
 public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
 {
     return(drawer.GetHeight(NUIDrawer.GenerateKey(property)));
 }