using System; using UnityEngine; [ExecuteInEditMode] public class Enabler : MonoBehaviour { private void Start() { } public void Enable() { if (this.goEnable != null) { this.goEnable.SetActive(true); } } public void Disable() { if (this.goEnable != null) { this.goEnable.SetActive(false); } } private void Update() { if (this.goEnable != null) { this.goEnable.SetActive(this.flag != 0); } } public int flag; public GameObject goEnable; }