Removed Many Things
This commit is contained in:
@@ -45,10 +45,10 @@ namespace BITKit.UX
|
||||
BIT4Log.Warning<UXUtils>($"document 未赋值或未找到");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
foreach (var fieldInfo in self.GetType()
|
||||
.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
|
||||
.Where(x=>x.GetCustomAttribute<UXBindPathAttribute>() is not null)
|
||||
.Where(x => x.GetCustomAttribute<UXBindPathAttribute>() is not null)
|
||||
)
|
||||
{
|
||||
var bindPathAtt = fieldInfo.GetCustomAttribute<UXBindPathAttribute>();
|
||||
@@ -57,29 +57,22 @@ namespace BITKit.UX
|
||||
{
|
||||
ve = ve.Q(path);
|
||||
}
|
||||
|
||||
//ve = document.rootVisualElement.Q(bindPathAtt.Path);
|
||||
if(bindPathAtt.CanBeNull is false && ve is null)
|
||||
if (bindPathAtt.CanBeNull is false && ve is null)
|
||||
BIT4Log.LogException(new NullReferenceException($"{self.GetType().Name}上未找到{bindPathAtt.Path}"));
|
||||
|
||||
if (fieldInfo.FieldType == typeof(UXContainer))
|
||||
try
|
||||
{
|
||||
fieldInfo.SetValue(self, new UXContainer(ve));
|
||||
fieldInfo.SetValue(self, ve);
|
||||
}
|
||||
else
|
||||
catch (Exception e)
|
||||
{
|
||||
try
|
||||
{
|
||||
fieldInfo.SetValue(self, ve);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
BIT4Log.Warning<UXUtils>(field!.Name);
|
||||
}
|
||||
BIT4Log.Warning<UXUtils>(field!.Name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// if (field.GetValue(self) is not UIDocument _document)
|
||||
// {
|
||||
// if (self is MonoBehaviour monoBehaviour && (document = monoBehaviour.GetComponentInParent<UIDocument>()))
|
||||
|
Reference in New Issue
Block a user