1
This commit is contained in:
27
Packages/Editor/ProviderInspector.cs
Normal file
27
Packages/Editor/ProviderInspector.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEngine.UIElements;
|
||||
using UnityEditor.UIElements;
|
||||
namespace BITKit
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(Provider))]
|
||||
public class ProviderInspector : PropertyDrawer
|
||||
{
|
||||
public override VisualElement CreatePropertyGUI(SerializedProperty property)
|
||||
{
|
||||
VisualElement root = new();
|
||||
ObjectField objectField = new(property.displayName);
|
||||
objectField.BindProperty(property);
|
||||
objectField.objectType=typeof(IProvider);
|
||||
|
||||
root.Add(objectField);
|
||||
return root;
|
||||
}
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
EditorGUI.ObjectField(position, property, label);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user