This commit is contained in:
CortexCore 2024-12-30 21:34:37 +08:00
parent 385220e0f6
commit 421ffc2c15
36 changed files with 41 additions and 40 deletions

View File

@ -51,7 +51,6 @@ namespace Net.Like.Xue.Tokyo.GameService
if (string.IsNullOrEmpty(portalNode.MapName?.Value) is false) if (string.IsNullOrEmpty(portalNode.MapName?.Value) is false)
{ {
_waitPlayer?.TrySetCanceled();
_waitPlayer = new(); _waitPlayer = new();
await _gameMapService.StartMapAsync(portalNode.MapName.Value); await _gameMapService.StartMapAsync(portalNode.MapName.Value);

View File

@ -166,6 +166,7 @@ namespace Net.Like.Xue.Tokyo
if (go) if (go)
Object.Destroy(go); Object.Destroy(go);
} }
_entities.Clear();
_healthService.OnHealthChanged-=OnHealthChanged; _healthService.OnHealthChanged-=OnHealthChanged;
} }
private void OnHealthChanged(int arg1, int arg2, int arg3, object arg4) private void OnHealthChanged(int arg1, int arg2, int arg3, object arg4)

View File

@ -26,10 +26,9 @@
<ui:Label tabindex="-1" text="100" parse-escape-sequences="true" display-tooltip-when-elided="true" class="tl" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; -unity-text-align: middle-center; -unity-font-style: bold;" /> <ui:Label tabindex="-1" text="100" parse-escape-sequences="true" display-tooltip-when-elided="true" class="tl" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; -unity-text-align: middle-center; -unity-font-style: bold;" />
</ui:VisualElement> </ui:VisualElement>
</ui:VisualElement> </ui:VisualElement>
<BITKit.UX.TabBar tabs="主页,记录" name="menu-tab" CurrentTab="0" style="position: absolute; left: 64px; right: 64px; top: 49px; flex-direction: row; justify-content: center;" />
<BITKit.UX.TabContainer TabPath="menu-tab" style="position: absolute; left: 32px; top: 220px; right: 32px; bottom: 32px;"> <BITKit.UX.TabContainer TabPath="menu-tab" style="position: absolute; left: 32px; top: 220px; right: 32px; bottom: 32px;">
<ui:Instance template="ux_menu_home" name="ux_menu_home" style="flex-grow: 1;" /> <ui:Instance template="ux_menu_home" name="ux_menu_home" style="flex-grow: 1;" />
<ui:VisualElement style="flex-grow: 1;" /> <ui:VisualElement style="flex-grow: 1;" />
<ui:VisualElement style="flex-grow: 1;" />
</BITKit.UX.TabContainer> </BITKit.UX.TabContainer>
<BITKit.UX.TabBar tabs="主页,记录" name="menu-tab" CurrentTab="0" allowFocus="false" style="position: absolute; left: 64px; right: 64px; top: 49px; flex-direction: row; justify-content: center;" />
</ui:UXML> </ui:UXML>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 398 KiB

After

Width:  |  Height:  |  Size: 648 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 613 KiB

After

Width:  |  Height:  |  Size: 786 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 741 KiB

After

Width:  |  Height:  |  Size: 2.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 898 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 831 KiB

After

Width:  |  Height:  |  Size: 823 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 415 KiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 826 KiB

After

Width:  |  Height:  |  Size: 971 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 944 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 424 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 404 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 MiB

After

Width:  |  Height:  |  Size: 5.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 473 KiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 KiB

After

Width:  |  Height:  |  Size: 960 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 506 KiB

After

Width:  |  Height:  |  Size: 647 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 801 KiB

After

Width:  |  Height:  |  Size: 1012 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 518 KiB

After

Width:  |  Height:  |  Size: 950 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 KiB

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 393 KiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 559 KiB

After

Width:  |  Height:  |  Size: 933 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 474 KiB

After

Width:  |  Height:  |  Size: 1.6 MiB

View File

@ -25,50 +25,48 @@ namespace BITKit.UX
public new class UxmlFactory : UxmlFactory<TabContainer, UxmlTraits> { } public new class UxmlFactory : UxmlFactory<TabContainer, UxmlTraits> { }
public TabContainer() public TabContainer()
{ {
RegisterCallback<AttachToPanelEvent>(OnAttachToPanel); RegisterCallback<AttachToPanelEvent>(RebuildOnEvent);
RegisterCallback<DetachFromPanelEvent>(OnDetachFromPanel); RegisterCallback<DetachFromPanelEvent>(RebuildOnEvent);
RegisterCallback<GeometryChangedEvent>(OnGeometryChanged); RegisterCallback<GeometryChangedEvent>(RebuildOnEvent);
RegisterCallback<BlurEvent>(RebuildOnEvent);
RegisterCallback<FocusEvent>(RebuildOnEvent);
} }
private void OnGeometryChanged(GeometryChangedEvent evt)
{
Rebuild();
}
public string TabPath public string TabPath
{ {
get=>_tabPath; get=>_tabPath;
set set
{ {
_tabPath = value; _tabPath = value;
Rebuild();
} }
} }
private string _tabPath; private string _tabPath;
private TabBar _tabBar; private TabBar _tabBar;
private int _index; private int _index;
private void OnDetachFromPanel(DetachFromPanelEvent evt) private void RebuildOnEvent<T>(T evt)
{ {
Rebuild(); Rebuild();
} }
private void OnAttachToPanel(AttachToPanelEvent evt)
{
Rebuild();
}
private void Rebuild() private void Rebuild()
{ {
if (_tabBar is not null) if (_tabBar is not null)
{ {
_tabBar.OnTabChanged -= OnTabChanged; _tabBar.OnTabChanged -= OnTabChanged;
} }
_tabBar = panel.visualTree.Q<TabBar>(TabPath); var p = parent;
while (p is not null)
{
_tabBar = p.Q<TabBar>(TabPath);
if (_tabBar is not null)
{
break;
}
p = p.parent;
}
if (_tabBar is not null) if (_tabBar is not null)
{ {
_tabBar.OnTabChanged += OnTabChanged; _tabBar.OnTabChanged += OnTabChanged;
} _index = _tabBar.CurrentTab;
if (_index <=0)
{
_index = 1;
} }
OnTabChanged(_index); OnTabChanged(_index);
} }
@ -76,7 +74,7 @@ namespace BITKit.UX
private void OnTabChanged(int obj) private void OnTabChanged(int obj)
{ {
_index = obj; _index = obj;
if (childCount <= 0) return; if (childCount < 0) return;
for (var i = 0; i < childCount; i++) for (var i = 0; i < childCount; i++)
{ {
var visualElement = this[i]; var visualElement = this[i];

View File

@ -94,13 +94,13 @@ TabBar Button:disabled {
} }
.gap-8 { .gap-8 {
margin-top:-8px; margin-top: -8px;
margin-right: -8px; margin-right: -8px;
margin-bottom: -8px; margin-bottom: -8px;
margin-left: -8px; margin-left: -8px;
} }
.gap-8 > *{ .gap-8 > * {
margin: 8px; margin: 8px;
} }
@ -109,7 +109,7 @@ TabBar Button:disabled {
margin-left: -8px; margin-left: -8px;
} }
.gap-x-8 > *{ .gap-x-8 > * {
margin-left: 8px; margin-left: 8px;
margin-right: 8px; margin-right: 8px;
} }
@ -119,7 +119,7 @@ TabBar Button:disabled {
margin-bottom: -8px; margin-bottom: -8px;
} }
.gap-y-8 > *{ .gap-y-8 > * {
margin-top: 8px; margin-top: 8px;
margin-bottom: 8px; margin-bottom: 8px;
} }
@ -504,3 +504,7 @@ Button.clear {
border-top-color: rgba(0, 0, 0, 0); border-top-color: rgba(0, 0, 0, 0);
border-bottom-color: rgba(0, 0, 0, 0); border-bottom-color: rgba(0, 0, 0, 0);
} }
TabContainer > * {
flex-grow: 1;
}

View File

@ -210,11 +210,11 @@ Material:
- _HorizonCloudStart: -0.01 - _HorizonCloudStart: -0.01
- _HorizonCloudStartPosition: -0.01 - _HorizonCloudStartPosition: -0.01
- _HorizonCloudStep: 25 - _HorizonCloudStep: 25
- _HorizonExponent: 3.7988865 - _HorizonExponent: 3.8273911
- _HorizonStep: 1000 - _HorizonStep: 1000
- _HorizonThickness: 1 - _HorizonThickness: 1
- _MoonGlow: 0.236 - _MoonGlow: 0.236
- _MoonLightIntensity: 0.0000098453875 - _MoonLightIntensity: 0.00001139632
- _MoonSize: 0.07 - _MoonSize: 0.07
- _MoonSoftEdge: 0.22 - _MoonSoftEdge: 0.22
- _OverheadCloudAltitude: 1000 - _OverheadCloudAltitude: 1000
@ -223,8 +223,8 @@ Material:
- _OverheadCloudFlowDirectionZ: 1 - _OverheadCloudFlowDirectionZ: 1
- _OverheadCloudFlowX: 1 - _OverheadCloudFlowX: 1
- _OverheadCloudFlowZ: 1 - _OverheadCloudFlowZ: 1
- _OverheadCloudRemapMax: 1.800091 - _OverheadCloudRemapMax: 1.8452492
- _OverheadCloudRemapMin: 0.13612132 - _OverheadCloudRemapMin: 0.13822451
- _OverheadCloudSize: 10 - _OverheadCloudSize: 10
- _OverheadCloudStep: 2 - _OverheadCloudStep: 2
- _StarsDensity0: 0.4 - _StarsDensity0: 0.4
@ -245,26 +245,26 @@ Material:
- _StarsTwinkle1: 6 - _StarsTwinkle1: 6
- _StarsTwinkle2: 2 - _StarsTwinkle2: 2
- _SunGlow: 0.45 - _SunGlow: 0.45
- _SunLightIntensity: 0.4233988 - _SunLightIntensity: 0.43717447
- _SunSize: 0.07 - _SunSize: 0.07
- _SunSoftEdge: 0.5 - _SunSoftEdge: 0.5
m_Colors: m_Colors:
- _DetailOverlayColor: {r: 1, g: 1, b: 1, a: 1} - _DetailOverlayColor: {r: 1, g: 1, b: 1, a: 1}
- _DetailOverlayTintColor: {r: 1, g: 1, b: 1, a: 1} - _DetailOverlayTintColor: {r: 1, g: 1, b: 1, a: 1}
- _FogColor: {r: 0.8490566, g: 0.69017035, b: 0.6287825, a: 1} - _FogColor: {r: 0.8490566, g: 0.69017035, b: 0.6287825, a: 1}
- _GroundColor: {r: 0.42867428, g: 0.4124601, b: 0.4438662, a: 1} - _GroundColor: {r: 0.42987296, g: 0.41393125, b: 0.44480956, a: 1}
- _HorizonCloudColor: {r: 1, g: 1, b: 1, a: 1} - _HorizonCloudColor: {r: 1, g: 1, b: 1, a: 1}
- _HorizonColor: {r: 0.89745224, g: 0.8769851, b: 0.7890967, a: 1} - _HorizonColor: {r: 0.89692837, g: 0.87857676, b: 0.79214877, a: 1}
- _MoonColor: {r: 1, g: 1, b: 1, a: 0} - _MoonColor: {r: 1, g: 1, b: 1, a: 0}
- _MoonDirection: {r: 0.24413833, g: 0.4449624, b: -0.8616293, a: 0} - _MoonDirection: {r: 0.25133455, g: 0.4580781, b: -0.85264057, a: 0}
- _MoonLightColor: {r: 0.8431373, g: 0.9843138, b: 1, a: 1} - _MoonLightColor: {r: 0.8431373, g: 0.9843138, b: 1, a: 1}
- _OverheadCloudColor: {r: 1, g: 1, b: 1, a: 0.99058735} - _OverheadCloudColor: {r: 1, g: 1, b: 1, a: 0.99229914}
- _SkyColor: {r: 0.23968326, g: 0.4430076, b: 0.6904413, a: 1} - _SkyColor: {r: 0.24189956, g: 0.44873634, b: 0.69703615, a: 1}
- _StarsColor0: {r: 0.96470594, g: 0.9450981, b: 0.76470596, a: 1} - _StarsColor0: {r: 0.96470594, g: 0.9450981, b: 0.76470596, a: 1}
- _StarsColor1: {r: 1, g: 0.5294118, b: 0.93725497, a: 1} - _StarsColor1: {r: 1, g: 0.5294118, b: 0.93725497, a: 1}
- _StarsColor2: {r: 0, g: 0.92549026, b: 1, a: 1} - _StarsColor2: {r: 0, g: 0.92549026, b: 1, a: 1}
- _SunColor: {r: 0.9716981, g: 0.9248151, b: 0.8473489, a: 1} - _SunColor: {r: 0.9716981, g: 0.92477906, b: 0.8472319, a: 1}
- _SunDirection: {r: -0.45199794, g: -0.23085254, b: 0.86162925, a: 0} - _SunDirection: {r: -0.46532097, g: -0.23765716, b: 0.8526403, a: 0}
- _SunLightColor: {r: 1, g: 0.99511117, b: 0.8632076, a: 1} - _SunLightColor: {r: 1, g: 0.99511117, b: 0.8632076, a: 1}
m_BuildTextureStacks: [] m_BuildTextureStacks: []
--- !u!21 &8993251732621375409 --- !u!21 &8993251732621375409