44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UIElements;
|
|
#if UNITY_EDITOR
|
|
using UnityEditor;
|
|
using UnityEditor.UIElements;
|
|
#endif
|
|
namespace BITKit
|
|
{
|
|
[System.Serializable]
|
|
public class ReferenceSO : ScriptableObject
|
|
{
|
|
[TextArea]
|
|
public string value;
|
|
}
|
|
[System.Serializable]
|
|
public record ReferenceScriptableObject : References
|
|
{
|
|
public ReferenceSO so;
|
|
public override string Get() => so.value.IsNullOrEmpty() ? so.name : so.value;
|
|
}
|
|
// #if UNITY_EDITOR
|
|
// [CustomPropertyDrawer(typeof(ReferenceScriptableObject))]
|
|
// public class ReferenceScriptableObjectDrawer : BITProperty
|
|
// {
|
|
// public override VisualElement CreatePropertyGUI(SerializedProperty property)
|
|
// {
|
|
// VisualElement root = new();
|
|
// root.Add(base.CreatePropertyGUI(property));
|
|
//
|
|
// Button button = new();
|
|
// root.Add(button);
|
|
// return root;
|
|
// }
|
|
// public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
|
// {
|
|
// base.OnGUI(position, property, label);
|
|
// EditorGUI.PropertyField(position, property);
|
|
// EditorGUI.LinkButton(position, "New Button");
|
|
// }
|
|
// }
|
|
// #endif
|
|
} |