LobbyUI 슬라이드 구조 적용

This commit is contained in:
aube.lee
2025-02-05 00:47:20 +09:00
parent 3455b9dd1b
commit b43bd19021
444 changed files with 192503 additions and 31 deletions

View File

@@ -0,0 +1,50 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace TON
{
public class SwipeController : MonoBehaviour
{
[SerializeField] int maxPage;
[SerializeField] int currentPage;
[SerializeField] Vector2 targetPos;
[SerializeField] Vector2 pageStep;
[SerializeField] RectTransform levelPagesRect;
[SerializeField] float tweenTime;
[SerializeField] LeanTweenType tweenType;
private void Awake()
{
currentPage = 1;
targetPos = levelPagesRect.localPosition;
}
public void Next()
{
if (currentPage < maxPage)
{
currentPage++;
targetPos += pageStep;
MovePage();
}
}
public void Previous()
{
if (currentPage > 1)
{
currentPage--;
targetPos -= pageStep;
MovePage();
}
}
public void MovePage()
{
levelPagesRect.LeanMoveLocal(targetPos, tweenTime).setEase(tweenType);
}
}
}