feat: map editor design (#53)

This commit is contained in:
M VINCENT PETT
2025-04-04 13:14:07 +02:00
committed by GitHub
parent 20b82fe6a9
commit be5ea1e60a
95 changed files with 2662 additions and 48 deletions

View File

@ -0,0 +1,41 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PageScript : MonoBehaviour
{
public List<GameObject> buttons;
public int visibleCount = 4;
private int currentIndex = 0;
public void ShowNext()
{
if (currentIndex + visibleCount < buttons.Count)
{
currentIndex++;
UpdateVisibility();
}
}
public void ShowPrevious()
{
if (currentIndex > 0)
{
currentIndex--;
UpdateVisibility();
}
}
void Start()
{
UpdateVisibility();
}
void UpdateVisibility()
{
for (int i = 0; i < buttons.Count; i++)
{
buttons[i].SetActive(i >= currentIndex && i < currentIndex + visibleCount);
}
}
}