mirror of
https://github.com/maxartz15/UnitySerializedReferenceUI.git
synced 2025-07-04 09:56:10 +02:00
formatting
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#if UNITY_EDITOR
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
@ -12,15 +13,13 @@ public class SerializeReferenceButtonAttributeDrawer : PropertyDrawer
|
||||
}
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
{
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
|
||||
|
||||
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);
|
||||
Rect labelPosition = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
|
||||
EditorGUI.LabelField(labelPosition, label);
|
||||
|
||||
IEnumerable<Func<Type, bool>> typeRestrictions = SerializedReferenceUIDefaultTypeRestrictions.GetAllBuiltInTypeRestrictions(fieldInfo);
|
||||
property.DrawSelectionButtonForManagedReference(position, typeRestrictions);
|
||||
|
||||
EditorGUI.PropertyField(position, property, GUIContent.none, true);
|
||||
|
@ -1,5 +1,6 @@
|
||||
#if UNITY_EDITOR
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
@ -14,13 +15,12 @@ public class SerializeReferenceMenuAttributeDrawer : PropertyDrawer
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
EditorGUI.BeginProperty(position, label, property);
|
||||
|
||||
var typeRestrictions = SerializedReferenceUIDefaultTypeRestrictions.GetAllBuiltInTypeRestrictions(fieldInfo);
|
||||
|
||||
IEnumerable<Func<Type, bool>> typeRestrictions = SerializedReferenceUIDefaultTypeRestrictions.GetAllBuiltInTypeRestrictions(fieldInfo);
|
||||
property.ShowContextMenuForManagedReferenceOnMouseMiddleButton(position, typeRestrictions);
|
||||
|
||||
EditorGUI.PropertyField(position, property, true);
|
||||
EditorGUI.EndProperty();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user