ui基本完毕,修了一大把的bug

This commit is contained in:
FloatGaming
2026-07-13 02:28:39 +08:00
parent 1e20d73e90
commit fd22501f71
958 changed files with 378289 additions and 41038 deletions
@@ -7,7 +7,8 @@ using UnityEngine.UI;
public class rankingListPrefab : MonoBehaviour
{
private static string RoomRankingServerText => LocalizationService.Get("ranking.room_server", "根据房间成绩动态排名,所在服务端:雅莉梦璃高新产业园");
private const string FallbackServerName = "雅莉梦璃高新产业园";
private const int FallbackCycleDays = 3;
[Header("shutbutton")]
public Button shutbutton;
@@ -116,17 +117,8 @@ public class rankingListPrefab : MonoBehaviour
return;
}
LeaderboardData data = null;
LeaderboardCacheService cache = LeaderboardCacheService.Instance;
if (cache != null && cache.TryGetCached(currentSongId, out LeaderboardData cached))
{
data = cached;
}
else
{
SetEmptyState(false, LocalizationService.Get("ranking.loading", "正在拉取排行榜..."));
data = await nm.GetLeaderboard(currentSongId);
}
SetEmptyState(false, LocalizationService.Get("ranking.loading", "正在拉取排行榜..."));
LeaderboardData data = await nm.GetLeaderboard(currentSongId, true);
if (data == null || data.rankings == null || data.rankings.Count == 0)
{
@@ -246,7 +238,7 @@ public class rankingListPrefab : MonoBehaviour
if (versionandServer != null)
{
versionandServer.text = isRoomRanking ? RoomRankingServerText : string.Empty;
versionandServer.text = BuildVersionAndServerText(data);
}
if (yourPositionText == null)
@@ -286,6 +278,50 @@ public class rankingListPrefab : MonoBehaviour
yourPositionText.text = LocalizationService.GetFormat("ranking.your_position_value", localEntry.total_score, localEntry.rank);
}
private string BuildVersionAndServerText(LeaderboardData data)
{
string serverName = data != null && !string.IsNullOrWhiteSpace(data.server_name)
? data.server_name
: FallbackServerName;
int cycleDays = data != null && data.leaderboard_cycle_days > 0
? data.leaderboard_cycle_days
: FallbackCycleDays;
int rankVersionId = data != null && data.rank_version_id > 0
? data.rank_version_id
: BuildFallbackRankVersionId(cycleDays);
string nextSettleAt = data != null && !string.IsNullOrWhiteSpace(data.next_settle_at)
? data.next_settle_at
: BuildFallbackNextSettleAt(cycleDays);
return $"每{cycleDays}自然日进行一次排行榜更新。排行榜版本{rankVersionId},下次统计日期{nextSettleAt} 所在服务端:{serverName}";
}
private static string BuildFallbackNextSettleAt(int cycleDays)
{
DateTime epoch = new DateTime(2026, 1, 1, 0, 0, 0, DateTimeKind.Local);
DateTime now = DateTime.Now;
int elapsedDays = (now.Date - epoch.Date).Days;
int nextSettleDays = ((elapsedDays / Mathf.Max(1, cycleDays)) + 1) * Mathf.Max(1, cycleDays);
DateTime nextSettle = epoch.AddDays(nextSettleDays);
if (nextSettle <= now)
{
nextSettle = nextSettle.AddDays(Mathf.Max(1, cycleDays));
}
return nextSettle.ToString("yyyy-MM-dd HH:mm:ss");
}
private static int BuildFallbackRankVersionId(int cycleDays)
{
string nextSettleAt = BuildFallbackNextSettleAt(cycleDays);
if (DateTime.TryParseExact(nextSettleAt, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime parsed))
{
return int.Parse(parsed.ToString("yyyyMMdd"));
}
return 0;
}
private static string FormatSubmitTime(LeaderboardEntry entry)
{
if (entry == null)
@@ -58,7 +58,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1}
m_Color: {r: 0.14117648, g: 0.34117648, b: 0.7764706, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
@@ -66,8 +66,8 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: bd4be44636ad6c24a9b117a7108a75e9, type: 3}
m_FontSize: 18
m_Font: {fileID: 12800000, guid: d254d20d93651ae448ff13d10dff30ab, type: 3}
m_FontSize: 20
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
@@ -137,7 +137,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1}
m_Color: {r: 0.14117648, g: 0.34117648, b: 0.7764706, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
@@ -145,8 +145,8 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: bd4be44636ad6c24a9b117a7108a75e9, type: 3}
m_FontSize: 18
m_Font: {fileID: 12800000, guid: d254d20d93651ae448ff13d10dff30ab, type: 3}
m_FontSize: 20
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
@@ -196,7 +196,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -22.589}
m_AnchoredPosition: {x: 0, y: -10}
m_SizeDelta: {x: 1100, y: 539.869}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3236275801312876574
@@ -332,7 +332,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 492b08f39f232d64e9ce8eb248b5daea, type: 3}
m_Sprite: {fileID: 21300000, guid: 3410813869a49f942b4e0198c93eb3ec, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
@@ -486,6 +486,81 @@ MonoBehaviour:
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: "\u62C9\u53D6\u6392\u884C\u699C\u5931\u8D25"
--- !u!1 &3019233615837960289
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 455604901716592107}
- component: {fileID: 2199194977054993423}
- component: {fileID: 1477107587712217919}
m_Layer: 0
m_Name: btm
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &455604901716592107
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3019233615837960289}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3018378993363515480}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 10}
m_SizeDelta: {x: 1050, y: 588.9733}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2199194977054993423
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3019233615837960289}
m_CullTransparentMesh: 1
--- !u!114 &1477107587712217919
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3019233615837960289}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.39215687}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 7edca03691f782d46ac361a681ce5685, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &3483362754365948650
GameObject:
m_ObjectHideFlags: 0
@@ -525,7 +600,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -53.89, y: 260.83}
m_AnchoredPosition: {x: -53.89, y: 272.9}
m_SizeDelta: {x: 888.204, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &3005028479092236020
@@ -714,7 +789,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 292.2}
m_AnchoredPosition: {x: 0, y: 332.1}
m_SizeDelta: {x: 1400, y: 24}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6664561848449007207
@@ -738,7 +813,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_Color: {r: 0.14117648, g: 0.34117648, b: 0.7764706, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
@@ -1144,7 +1219,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1}
m_Color: {r: 0.14117648, g: 0.34117648, b: 0.7764706, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
@@ -1152,8 +1227,8 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: bd4be44636ad6c24a9b117a7108a75e9, type: 3}
m_FontSize: 18
m_Font: {fileID: 12800000, guid: d254d20d93651ae448ff13d10dff30ab, type: 3}
m_FontSize: 20
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
@@ -1195,6 +1270,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 455604901716592107}
- {fileID: 2611590964116081061}
- {fileID: 4148558001495883808}
- {fileID: 7280264963986874822}
@@ -1237,7 +1313,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 7f3b1220317607e44bbb8f0e1998044a, type: 3}
m_Sprite: {fileID: 2139583702370686162, guid: f034ddca36ad627428d85c127caac8da, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
@@ -1305,7 +1381,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1}
m_Color: {r: 0.14117648, g: 0.34117648, b: 0.7764706, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
@@ -1313,8 +1389,8 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: bd4be44636ad6c24a9b117a7108a75e9, type: 3}
m_FontSize: 18
m_Font: {fileID: 12800000, guid: d254d20d93651ae448ff13d10dff30ab, type: 3}
m_FontSize: 20
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
@@ -1360,8 +1436,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: -324.4}
m_SizeDelta: {x: 1400, y: 24}
m_AnchoredPosition: {x: 0, y: -317}
m_SizeDelta: {x: 1400, y: 28}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &341918732991438692
CanvasRenderer:
@@ -1384,7 +1460,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_Color: {r: 0.14117648, g: 0.34117648, b: 0.7764706, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
@@ -1393,7 +1469,7 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: dfa10de3e2846524089b5073175cd151, type: 3}
m_FontSize: 22
m_FontSize: 28
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
@@ -1463,7 +1539,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_Color: {r: 0.41960785, g: 0.5411765, b: 0.8039216, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
@@ -1471,8 +1547,8 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: bd4be44636ad6c24a9b117a7108a75e9, type: 3}
m_FontSize: 16
m_Font: {fileID: 12800000, guid: d254d20d93651ae448ff13d10dff30ab, type: 3}
m_FontSize: 18
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
@@ -1543,7 +1619,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1}
m_Color: {r: 0.14117648, g: 0.34117648, b: 0.7764706, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
@@ -1551,8 +1627,8 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: bd4be44636ad6c24a9b117a7108a75e9, type: 3}
m_FontSize: 18
m_Font: {fileID: 12800000, guid: d254d20d93651ae448ff13d10dff30ab, type: 3}
m_FontSize: 20
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
@@ -1998,7 +2074,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 312.4}
m_AnchoredPosition: {x: 0, y: 374.2}
m_SizeDelta: {x: 1400, y: 81.672}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4558535259015521777
@@ -2022,7 +2098,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
@@ -2031,12 +2107,12 @@ MonoBehaviour:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: dfa10de3e2846524089b5073175cd151, type: 3}
m_FontSize: 40
m_FontSize: 32
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
m_MaxSize: 230
m_Alignment: 1
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0