fix: improve minigame reconnect flow
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user