using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class WinPanel : MonoBehaviour { [SerializeField] private Button nextButton; [SerializeField] private Button closeButton; // Start is called before the first frame update void Start() { } private void OnEnable() { nextButton.onClick.AddListener(NextEvent); closeButton.onClick.AddListener(CloseEvent); } // Update is called once per frame void Update() { } private void OnDisable() { nextButton.onClick.RemoveListener(NextEvent); closeButton.onClick.RemoveListener(CloseEvent); } void NextEvent() { } void CloseEvent() { } }