Пример #1
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            EditorGUI.BeginProperty(position, label, property);

            float thirdWidth = EditorExtentions.GetCurrViewWidth(3);

            Rect titlePos = position;

            titlePos.width = thirdWidth;
            EditorGUI.LabelField(titlePos, property.displayName);

            f    = property.FindPropertyRelative(fName);
            sqrF = property.FindPropertyRelative(sqrFName);

            Rect fPos = EditorExtentions.MoveRectRight(thirdWidth, titlePos);

            f.floatValue = EditorGUI.FloatField(fPos, f.floatValue);
            Rect sqrFPos = EditorExtentions.MoveRectRight(thirdWidth, fPos);

            EditorGUI.LabelField(sqrFPos, sqrF.floatValue.ToString());

            CorrectSqruaredValue();

            EditorGUI.EndProperty();
        }
Пример #2
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            const string       selectionsName = "selections";
            SerializedProperty selectionsProp = property.FindPropertyRelative(selectionsName);
            Rect  namePos   = position;
            float halfWidth = namePos.width / 2;

            namePos.width = halfWidth;

            Rect maskPos = EditorExtentions.MoveRectRight(halfWidth, namePos);

            EditorGUI.LabelField(namePos, property.displayName);

            Object target = property.serializedObject.targetObject;

            System.Object   val       = fieldInfo.GetValue(target);
            MultiSelectType actualObj = (MultiSelectType)val;

            selectionsProp.intValue = EditorGUI.MaskField(maskPos, selectionsProp.intValue, actualObj.possiblities);
        }