12345678910111213141516171819202122232425262728293031323334353637383940 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public static class ScrollHelper
- {
- private static float ScaleFactor;
- private static ScrollRect ScrollRect;
- private static LayoutGroup LayoutGroup;
- private static RectTransform RectTransform;
- public static void Locate(this ScrollRect scrollRect, float verticalPos, float horizontalPos)
- {
- Vector2 viewSize = scrollRect.viewport.rect.size;
- Vector2 contentSize = scrollRect.content.rect.size;
- if (viewSize.x >= contentSize.x && viewSize.y >= contentSize.y)
- {
- return;
- }
- }
- private static void Init(ScrollRect scrollRect)
- {
- ScaleFactor = scrollRect.GetComponentInChildren<Graphic>().canvas.scaleFactor;
- LayoutGroup = scrollRect.content.GetComponent<LayoutGroup>();
- RectTransform = scrollRect.GetComponent<RectTransform>();
- }
- private static void CalVertical(float normalizedPos)
- {
- }
- private static void CalHorizontal()
- {
- }
- }
|