整合包
gameplay bundle has been imported together
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
[RequireComponent(typeof(Toggle))]
|
||||
public class UI_Toggle : MonoBehaviour
|
||||
{
|
||||
Toggle toggle;
|
||||
void Awake()
|
||||
{
|
||||
TryGetComponent(out toggle);
|
||||
Active(toggle.isOn);
|
||||
toggle.onValueChanged.AddListener(Active);
|
||||
}
|
||||
void Active(bool isOn)
|
||||
{
|
||||
toggle.graphic.gameObject.SetActive(isOn);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user