Add [Parameter] to BaseControl.Property

This commit is contained in:
Garry Newman
2025-12-19 20:59:33 +00:00
parent 87db59546e
commit f6ad79479f

View File

@@ -1,11 +1,10 @@
using System; namespace Sandbox.UI;
namespace Sandbox.UI;
public class BaseControl : Panel public class BaseControl : Panel
{ {
SerializedProperty _property; SerializedProperty _property;
[Parameter]
public SerializedProperty Property public SerializedProperty Property
{ {
get => _property; get => _property;
@@ -56,7 +55,7 @@ public class BaseControl : Panel
var type = property.PropertyType; var type = property.PropertyType;
var allAttributes = Game.TypeLibrary.GetTypesWithAttribute<CustomEditorAttribute>( false ) var allAttributes = Game.TypeLibrary.GetTypesWithAttribute<CustomEditorAttribute>( false )
.Where( x => x.Type.TargetType.IsAssignableTo( typeof( BaseControl ) )) .Where( x => x.Type.TargetType.IsAssignableTo( typeof( BaseControl ) ) )
.ToArray(); .ToArray();
var allEditors = allAttributes var allEditors = allAttributes