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