Пример #1
0
        public void JumpTo(RectTransformPosition position)
        {
            var lockedPosition = position.WithLockedAxes(transform, _lockHorizontal, _lockVertical);

            transform.MoveAnchorsKeepPosition(lockedPosition.anchorMin, lockedPosition.anchorMax);
            transform.SetOffsets(lockedPosition.offsetMin, lockedPosition.offsetMax);
        }
Пример #2
0
 public void MoveTo(RectTransformPosition position, float?time = null)
 {
     if (!Application.isPlaying || singleCoroutine == null || !gameObject.activeInHierarchy || (time ?? defaultMoveTime) <= 0)
     {
         JumpTo(position);
     }
     else
     {
         singleCoroutine.Start(DoMoveTo(position.WithLockedAxes(transform, _lockHorizontal, _lockVertical), time ?? defaultMoveTime));
     }
 }