Removed Many Things

This commit is contained in:
CortexCore
2024-08-13 18:42:51 +08:00
parent c563c539a5
commit 79985ad6f5
1363 changed files with 5892 additions and 71512 deletions

View File

@@ -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>()))