using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class IchorBtn : MonoBehaviour { public Button btn; public IchorPanel ichorPanel; public bool isShow; // Start is called before the first frame update void Start() { btn.onClick.AddListener(OnClickBtn); } void OnClickBtn() { if (!isShow) { ichorPanel.ShowPanel(); isShow = true; } else { ichorPanel.HidePanel(); isShow = false; } } }