Skip to content

Commit 444af16

Browse files
author
v_shanxia
committed
fix:将title居中
1 parent b798f8d commit 444af16

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Demo/API_V2/Assets/API/Touch/Touch.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,14 @@ public class TouchTest : MonoBehaviour,
1414
private Dictionary<int, List<GameObject>> touchCircles = new Dictionary<int, List<GameObject>>();
1515
// 移除currentPointerId字段,改为完全依赖touchCircles字典管理所有触点
1616

17+
private RectTransform title;
1718
void Start()
1819
{
20+
// 根据系统安全区域调整标题的位置
21+
title.anchoredPosition = new Vector2(
22+
title.anchoredPosition.x,
23+
-125f - (float)GameManager.Instance.WindowInfo.safeArea.top
24+
);
1925
Debug.Log("TouchTest脚本初始化开始");
2026

2127
// 确保Canvas设置正确

0 commit comments

Comments
 (0)