auth and rc purchase dummy

This commit is contained in:
2026-04-03 19:04:36 +05:30
parent b8ce9120d5
commit ef89a7320a
15 changed files with 9088 additions and 1865 deletions
+45
View File
@@ -0,0 +1,45 @@
using UnityEngine;
using UnityEngine.UI;
public class TabGroup : MonoBehaviour
{
public Button[] buttons;
public GameObject[] contents;
public int selectedIndex = 0;
void OnValidate(){
if(buttons == null || buttons.Length == 0){
buttons=GetComponentsInChildren<Button>();
}
}
void Awake()
{
SetSelectedIndex(selectedIndex);
for(int i=0; i < buttons.Length; i++)
{
int index = i;
buttons[i].onClick.AddListener(() => SetSelectedIndex(index));
}
}
public void SetSelectedIndex(int index)
{
if(index < 0 || index >= buttons.Length) return;
selectedIndex = index;
for(int i = 0; i < buttons.Length; i++)
{
buttons[i].targetGraphic.color = i == index ? buttons[i].colors.normalColor : buttons[i].colors.disabledColor;
try{
contents[i].SetActive(i == index);
}catch{
Debug.LogError("Content not found for index: " + i);
}
}
}
}