organize into upm directory structure

This commit is contained in:
Phill
2021-05-26 14:44:53 -04:00
parent c8d7471db9
commit ffff19acd5
78 changed files with 11 additions and 31 deletions

View File

@ -0,0 +1,8 @@
using System;
using UnityEngine;
[AttributeUsage(AttributeTargets.Field)]
public class SerializeReferenceButtonAttribute : PropertyAttribute
{
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: c64e0f68b41b48939c9b98cc29a19b20
timeCreated: 1579584059

View File

@ -0,0 +1,31 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
[CustomPropertyDrawer(typeof(SerializeReferenceButtonAttribute))]
public class SerializeReferenceButtonAttributeDrawer : PropertyDrawer
{
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
return EditorGUI.GetPropertyHeight(property, true);
}
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();
}
}
#endif

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5a07638044724309b6088c28a11a15af
timeCreated: 1579584059