fix: 모바일 기기의 SafeArea에 맞춰 화면 비율 고정 로직 적용

This commit is contained in:
aube.lee
2025-03-06 00:08:03 +09:00
parent 8f69ecc429
commit 7fa43b35b4
22 changed files with 844 additions and 196 deletions

View File

@@ -0,0 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace TON
{
public class RectHelper : MonoBehaviour
{
Vector2 minAnchor;
Vector2 maxAnchor;
private void Start()
{
var Myrect = this.GetComponent<RectTransform>();
minAnchor = Screen.safeArea.min;
maxAnchor = Screen.safeArea.max;
minAnchor.x /= Screen.width;
minAnchor.y /= Screen.height;
maxAnchor.x /= Screen.width;
maxAnchor.y /= Screen.height;
Myrect.anchorMin = minAnchor;
Myrect.anchorMax = maxAnchor;
}
}
}