31 lines
795 B
C#
31 lines
795 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class ToggleGroupSelf : MonoBehaviour
|
|
{
|
|
public Color m_ActiveColor;
|
|
public Color m_UnActiveColor;
|
|
public List<Toggle> m_SelfToggles = new List<Toggle>();
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
foreach (Toggle item in m_SelfToggles)
|
|
{
|
|
item.onValueChanged.AddListener((b) =>
|
|
{
|
|
item.GetComponentInChildren<TextMeshProUGUI>().color = b ? m_ActiveColor : m_UnActiveColor;
|
|
item.GetComponentInChildren<TextMeshProUGUI>().fontSize = b ? 24 : 22;
|
|
});
|
|
}
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|