using UnityEngine; namespace Plugins.CxShine.SafeArea { public class SafeAreaBottom : MonoBehaviour { public void Start() { //计算屏幕顶部异形大小 var safeAreaOffset = (int)(Screen.height - Screen.safeArea.yMax); //UI偏移 var rectTransform = transform.GetComponent(); rectTransform.offsetMax = new Vector2(0, -safeAreaOffset); } } }