using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { [XLua.Hotfix] public class FuncSwitchBehaviour : MonoBehaviour { [Header("功能开关Id")] [SerializeField] int swithId; [SerializeField] GameObject open; [SerializeField] GameObject close; FuncSwitchModel switchModel { get { return ModelCenter.Instance.GetModel(); } } private void OnEnable() { SetDisplay(); } private void SetDisplay() { bool isOpen = switchModel.IsOpen(swithId); open.SetActive(isOpen); close.SetActive(!isOpen); } } }