This commit is contained in:
CortexCore
2024-07-15 17:26:08 +08:00
parent de0bae347d
commit e686eb89ab
4 changed files with 74 additions and 45 deletions

View File

@@ -121,48 +121,54 @@ namespace BITKit.UX
}
private void Update()
{
while (RegistryQueue.TryDequeue(out var result))
try
{
if (result is null) continue;
EntryGroup.list.Add(result);
Panels.Set(result.Index, result);
}
while (UnRegistryQueue.TryDequeue(out var result))
{
if (result is null) continue;
EntryGroup.list.Remove(result);
Panels.Remove(result.Index);
}
if (ReturnBuffer.TryGetRelease(out var returnPanel))
{
EntryGroup.Entry(x=>x.Index==returnPanel.Index);
BITAppForUnity.AllowCursor.SetElements(this, returnPanel.AllowCursor);
BITInputSystem.AllowInput.SetElements(this, returnPanel.AllowInput);
}
if (EntryQueue.TryPop(out var nextPanel))
{
if (nextPanel.IsWindow)
while (RegistryQueue.TryDequeue(out var result))
{
WindowEntryGruop.Entry(nextPanel);
return;
if (result is null) continue;
EntryGroup.list.Add(result);
Panels.Set(result.Index, result);
}
while (UnRegistryQueue.TryDequeue(out var result))
{
if (result is null) continue;
EntryGroup.list.Remove(result);
Panels.Remove(result.Index);
}
WindowEntryGruop.Entry(-1);
History.Push(CurrentPanel);
EntryGroup.Entry(x=>x.Index==nextPanel.Index);
BITAppForUnity.AllowCursor.SetElements(this, nextPanel.AllowCursor);
BITInputSystem.AllowInput.SetElements(this, nextPanel.AllowInput);
}
if (EntryGroup.TryGetEntried(out var currentPanel))
if (ReturnBuffer.TryGetRelease(out var returnPanel))
{
EntryGroup.Entry(x=>x.Index==returnPanel.Index);
BITAppForUnity.AllowCursor.SetElements(this, returnPanel.AllowCursor);
BITInputSystem.AllowInput.SetElements(this, returnPanel.AllowInput);
}
if (EntryQueue.TryPop(out var nextPanel))
{
if (nextPanel.IsWindow)
{
WindowEntryGruop.Entry(nextPanel);
return;
}
WindowEntryGruop.Entry(-1);
History.Push(CurrentPanel);
EntryGroup.Entry(x=>x.Index==nextPanel.Index);
BITAppForUnity.AllowCursor.SetElements(this, nextPanel.AllowCursor);
BITInputSystem.AllowInput.SetElements(this, nextPanel.AllowInput);
}
if (EntryGroup.TryGetEntried(out var currentPanel))
{
currentPanel.OnUpdate(Time.deltaTime);
};
if(WindowEntryGruop.TryGetEntried(out var windowPanel))
{
windowPanel.OnUpdate(Time.deltaTime);
}
}
catch (Exception e)
{
currentPanel.OnUpdate(Time.deltaTime);
};
if(WindowEntryGruop.TryGetEntried(out var windowPanel))
{
windowPanel.OnUpdate(Time.deltaTime);
BIT4Log.LogException(e);
}
}