Merge branch 'develop' of github.com:boudji-ludwig-pett/cnam-geometry-dash into map-editor-design

This commit is contained in:
Vincent PETT
2025-03-31 17:27:56 +02:00
79 changed files with 7276 additions and 3159 deletions

View File

@@ -0,0 +1,41 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PageScript : MonoBehaviour
{
public List<GameObject> buttons; // À assigner dans linspector
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);
}
}
}