1234567891011121314151617181920212223242526272829303132333435363738 |
- 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;
- }
|