Merge branch 'main' of http://server.bitfall.icu:3000/root/BITKit
This commit is contained in:
commit
1c00d8fb1c
|
@ -11,6 +11,10 @@ namespace BITKit.Mod
|
||||||
|
|
||||||
public static async UniTask<T> LoadAsset<T>(string location) where T : class
|
public static async UniTask<T> LoadAsset<T>(string location) where T : class
|
||||||
{
|
{
|
||||||
|
if (LoadAssetAsyncFactory is null)
|
||||||
|
{
|
||||||
|
throw new Exception("LoadAssetAsyncFactory is null!Make sure Processor has been initialized.");
|
||||||
|
}
|
||||||
foreach (var func in LoadAssetAsyncFactory.CastAsFunc())
|
foreach (var func in LoadAssetAsyncFactory.CastAsFunc())
|
||||||
{
|
{
|
||||||
var value = await func.Invoke(location);
|
var value = await func.Invoke(location);
|
||||||
|
|
|
@ -98,10 +98,18 @@ namespace BITKit
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(_isDisposed)return;
|
if(_isDisposed)return;
|
||||||
|
|
||||||
if (IsSyncContext)
|
if (IsSyncContext)
|
||||||
{
|
{
|
||||||
await BITApp.SwitchToMainThread();
|
await BITApp.SwitchToMainThread();
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
if (UnityEditor.EditorApplication.isPaused)
|
||||||
|
{
|
||||||
|
_timer.Start();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if(_isDisposed)return;
|
if(_isDisposed)return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,7 +173,9 @@ namespace BITKit
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
_isDisposed = true;
|
||||||
|
_timer.Stop();
|
||||||
|
_timer.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ namespace BITKit.UX
|
||||||
{
|
{
|
||||||
|
|
||||||
// An element that displays progress inside a partially filled circle
|
// An element that displays progress inside a partially filled circle
|
||||||
public class DashBoardProgress : VisualElement
|
public class DashBoardProgress : VisualElement,INotifyValueChanged<float>
|
||||||
{
|
{
|
||||||
public new class UxmlTraits : VisualElement.UxmlTraits
|
public new class UxmlTraits : VisualElement.UxmlTraits
|
||||||
{
|
{
|
||||||
|
@ -97,5 +97,16 @@ namespace BITKit.UX
|
||||||
painter.Arc(new Vector2(width * 0.5f, height * 0.5f), width*0.5f - painter.lineWidth/2f, startAngle, endAngle);
|
painter.Arc(new Vector2(width * 0.5f, height * 0.5f), width*0.5f - painter.lineWidth/2f, startAngle, endAngle);
|
||||||
painter.Stroke();
|
painter.Stroke();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetValueWithoutNotify(float newValue)
|
||||||
|
{
|
||||||
|
value = newValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float value
|
||||||
|
{
|
||||||
|
get => progress;
|
||||||
|
set => progress = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -92,7 +92,7 @@ namespace BITKit.UX
|
||||||
|
|
||||||
//ve = document.rootVisualElement.Q(bindPathAtt.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}"));
|
BIT4Log.LogException(new NullReferenceException($"{self.GetType().Name},{rootVisualElement.name}上未找到{bindPathAtt.Path}"));
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue