1
0
mirror of synced 2024-12-21 18:55:54 +01:00
WACVR/Assets/Script/Essential/TabManager.cs

24 lines
499 B
C#
Raw Normal View History

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