Keep local version of files

This commit is contained in:
2026-10-08 00:49:10 +05:30
parent 7fa0621ff8
commit 053665c690
7343 changed files with 5470578 additions and 5470528 deletions
+45 -45
View File
@@ -1,45 +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);
}
}
}
}
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);
}
}
}
}