2022-10-03 02:04:54 +02:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
2022-11-05 20:23:31 +01:00
|
|
|
using UnityEngine.UI;
|
2022-10-03 02:04:54 +02:00
|
|
|
|
|
|
|
public class TabManager : MonoBehaviour
|
|
|
|
{
|
2022-11-05 20:23:31 +01:00
|
|
|
public Button DefautTabButton;
|
|
|
|
public List<GameObject> Tabs = new List<GameObject>();
|
|
|
|
|
|
|
|
[ExecuteAlways]
|
2022-10-03 02:04:54 +02:00
|
|
|
void Start()
|
|
|
|
{
|
2022-11-05 20:23:31 +01:00
|
|
|
DefautTabButton.onClick?.Invoke();
|
2022-10-03 02:04:54 +02:00
|
|
|
}
|
2022-11-05 20:23:31 +01:00
|
|
|
|
|
|
|
public void OnTabClicked(GameObject tab)
|
2022-10-03 02:04:54 +02:00
|
|
|
{
|
2022-11-05 20:23:31 +01:00
|
|
|
foreach (GameObject t in Tabs)
|
|
|
|
t.SetActive(false);
|
|
|
|
tab.SetActive(true);
|
2022-10-03 02:04:54 +02:00
|
|
|
}
|
|
|
|
}
|