fix: improve minigame reconnect flow

This commit is contained in:
ud18010
2026-07-29 19:30:50 +08:00
parent 6a5e534d00
commit 42c3874d82
21 changed files with 979 additions and 52 deletions
@@ -0,0 +1,30 @@
using NUnit.Framework;
using UnityEditor;
using UnityEngine;
public sealed class MatchWaitingPrefabLayoutTests
{
private const string PrefabPath = "Assets/Game/Art/UI/Prefab/UI_MatchWaiting.prefab";
[Test]
public void WaitingPanel_IsCenteredInSafeArea()
{
GameObject prefab = AssetDatabase.LoadAssetAtPath<GameObject>(PrefabPath);
Assert.That(prefab, Is.Not.Null);
RectTransform root = prefab.GetComponent<RectTransform>();
Assert.That(root.anchorMin, Is.EqualTo(Vector2.zero));
Assert.That(root.anchorMax, Is.EqualTo(Vector2.one));
Assert.That(root.anchoredPosition, Is.EqualTo(Vector2.zero));
Assert.That(root.sizeDelta, Is.EqualTo(Vector2.zero));
Transform panel = prefab.transform.Find("SafeArea/Panel_Waiting");
Assert.That(panel, Is.Not.Null);
RectTransform rect = panel.GetComponent<RectTransform>();
Assert.That(rect.anchorMin, Is.EqualTo(new Vector2(0.5f, 0.5f)));
Assert.That(rect.anchorMax, Is.EqualTo(new Vector2(0.5f, 0.5f)));
Assert.That(rect.pivot, Is.EqualTo(new Vector2(0.5f, 0.5f)));
Assert.That(rect.anchoredPosition, Is.EqualTo(Vector2.zero));
}
}