| | |
| | | |
| | | private CanvasScaler canvasScaler; |
| | | |
| | | public const int SafeWidth = 60; |
| | | public const int SafeHeightUp = 50; |
| | | public const int SafeHeightDown = 30; |
| | | #endregion |
| | | |
| | | #region Unity生命周期 |
| | |
| | | if (Screen.height / Screen.width > 1.8)//宽屏需要适配 |
| | | { |
| | | //上下各间隔SafeWidth |
| | | _rectTransform.offsetMax = new Vector2(0, -SafeWidth); //上 |
| | | // _rectTransform.offsetMin = new Vector2(0, SafeWidth); //下 |
| | | _rectTransform.offsetMax = new Vector2(0, -SafeHeightUp); //上 |
| | | _rectTransform.offsetMin = new Vector2(0, SafeHeightDown); //下 |
| | | } |
| | | originalPosition = _rectTransform.anchoredPosition; |
| | | } |