Update HorizontalScrollSnap.cs

pull/474/head
GoShikhar 2024-05-17 21:01:54 +05:30
parent 6e1f1afca5
commit 0faa5fc08e
1 changed files with 2 additions and 2 deletions

View File

@ -17,14 +17,14 @@ namespace UnityEngine.UI.Extensions
void Start() void Start()
{ {
_isVertical = false; _isVertical = false;
_childAnchorPoint = new Vector2(0, 0.5f);
_currentPage = StartingScreen; _currentPage = StartingScreen;
panelDimensions = gameObject.GetComponent<RectTransform>().rect; panelDimensions = gameObject.GetComponent<RectTransform>().rect;
UpdateLayout(); UpdateLayout();
} }
void Update() protected override void Update()
{ {
base.Update();
updated = false; updated = false;
if (!_lerp && (_scroll_rect.velocity == Vector2.zero && _scroll_rect.inertia)) if (!_lerp && (_scroll_rect.velocity == Vector2.zero && _scroll_rect.inertia))