This commit is contained in:
CortexCore
2023-10-06 23:43:19 +08:00
parent ebf9c1f526
commit 2c4710bc5d
186 changed files with 111802 additions and 764 deletions

View File

@@ -20,25 +20,25 @@ namespace BITKit
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
// #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
}