| | |
| | | Vector2 adjustedPos = new Vector2(worldPos.x, worldPos.y + (!isDownShow ? screenHeight * 0.5f : -screenHeight * 0.5f)); |
| | | |
| | | Vector2 screenAdjustedPos = CameraManager.uiCamera.WorldToScreenPoint(adjustedPos); |
| | | screenAdjustedPos.x = Mathf.Clamp(screenAdjustedPos.x, rectTransform.rect.width * 0.5f, Screen.width - rectTransform.rect.width * 0.5f); |
| | | var rectWidth = rectTransform.rect.width * Screen.width / canvasScaler.referenceResolution.x; |
| | | screenAdjustedPos.x = Mathf.Clamp(screenAdjustedPos.x, rectWidth * 0.5f, Screen.width - rectWidth * 0.5f); |
| | | screenAdjustedPos.y = Mathf.Clamp(screenAdjustedPos.y, rectTransform.rect.height * 0.5f, Screen.height - rectTransform.rect.height * 0.5f - 15); |
| | | |
| | | adjustedPos = CameraManager.uiCamera.ScreenToWorldPoint(screenAdjustedPos); |
| | |
| | | protected Vector3 originalPosition; |
| | | protected Sequence currentAnimation; |
| | | |
| | | private CanvasScaler canvasScaler; |
| | | public CanvasScaler canvasScaler |
| | | { |
| | | get; |
| | | private set; |
| | | } |
| | | |
| | | public const int SafeHeightUp = 50; |
| | | public const int SafeHeightDown = 30; |