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

        var typeRestrictions = SerializedReferenceUIDefaultTypeRestrictions.GetAllBuiltInTypeRestrictions(fieldInfo);

        property.ShowContextMenuForManagedReferenceOnMouseMiddleButton(position, typeRestrictions);

        EditorGUI.PropertyField(position, property, true);
        EditorGUI.EndProperty();
    }
    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    {
        EditorGUI.BeginProperty(position, label, property);

        var labelPosition = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);

        EditorGUI.LabelField(labelPosition, label);

        var typeRestrictions = SerializedReferenceUIDefaultTypeRestrictions.GetAllBuiltInTypeRestrictions(fieldInfo);

        property.DrawSelectionButtonForManagedReference(position, typeRestrictions);

        EditorGUI.PropertyField(position, property, GUIContent.none, true);

        EditorGUI.EndProperty();
    }