This commit is contained in:
CortexCore 2024-12-26 23:07:17 +08:00
commit cd35241711
3 changed files with 16 additions and 13 deletions

View File

@ -83,6 +83,8 @@ namespace BITKit
TickRate = 1; TickRate = 1;
} }
_timer.Interval = 1000d / TickRate;
_timer.Elapsed += OnElapsed; _timer.Elapsed += OnElapsed;
if (_isDisposed is false) if (_isDisposed is false)

View File

@ -142,24 +142,22 @@ namespace BITKit
} }
} }
#endif #endif
#if UNITY_5_3_OR_NEWER
if (IsEditorSimulateMode is false && isOffline)
{
initParameters = new OfflinePlayModeParameters();
}
#else
if (isOffline)
{
initParameters = new OfflinePlayModeParameters();
}
#endif
if (isOffline&& IsEditorSimulateMode is false)
{
initParameters = new OfflinePlayModeParameters();
}
InitializationOperation initOperation = null; InitializationOperation initOperation = null;
try try
{ {
initOperation = package.InitializeAsync(initParameters); initOperation = package.InitializeAsync(initParameters);
_progressLabel.text ="正在初始化资源系统...";
var text = $"正在初始化资源系统...,使用{initParameters.GetType().Name}";
_progressLabel.text =text;
Debug.Log(text);
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -50,6 +50,9 @@ namespace BITKit.UX
VisualTreeAsset = await ModService.LoadAsset<VisualTreeAsset>(DocumentPath); VisualTreeAsset = await ModService.LoadAsset<VisualTreeAsset>(DocumentPath);
RootVisualElement = UXService.Root.As<VisualElement>().Create(VisualTreeAsset); RootVisualElement = UXService.Root.As<VisualElement>().Create(VisualTreeAsset);
RootVisualElement.name = DocumentPath;
RootVisualElement.pickingMode = PickingMode.Ignore; RootVisualElement.pickingMode = PickingMode.Ignore;
RootVisualElement.style.position = Position.Absolute; RootVisualElement.style.position = Position.Absolute;
RootVisualElement.style.left = 0; RootVisualElement.style.left = 0;
@ -78,12 +81,12 @@ namespace BITKit.UX
invisible.style.backgroundColor = new Color(0, 0, 0, 0.9f); invisible.style.backgroundColor = new Color(0, 0, 0, 0.9f);
} }
UXUtils.Inject(this); UXUtils.Inject(this,RootVisualElement);
RootVisualElement.SetActive(false);
OnInitiated?.Invoke(); OnInitiated?.Invoke();
RootVisualElement.SetActive(false);
await OnInitiatedAsync.UniTaskFunc(); await OnInitiatedAsync.UniTaskFunc();
WaitUtilInitialized.TrySetResult(); WaitUtilInitialized.TrySetResult();