void OnEnable() { pageCount = transform.childCount; swipeGesture .OnDragRelative .Where(_ => this.moveAnimation == null || !this.moveAnimation.IsPlaying()) // 애니메이션 실행 중이 아니 .Subscribe(delta => { rectTransform.anchoredPosition += delta; }); swipeGesture .OnSwipe() .Where(_ => this.moveAnimation == null || !this.moveAnimation.IsPlaying()) // 애니메이션 실행 중이 없다 .Do(moveDirection => { switch (moveDirection) { case MoveDirection.Right: if (currentPage > 0) { this.currentPage--; } break; case MoveDirection.Left: if (currentPage < pageCount - 1) { this.currentPage++; } break; } }) .Subscribe(_ => { this.moveAnimation = this.rectTransform .DOAnchorPos(anchorBeginPosition + currentPage * this.pageWidthVector, 1.0f) .SetEase(Ease.OutBounce) .Play(); }); }