using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class StartPanel : MonoBehaviour { [SerializeField] private Button _startButton; // Start is called before the first frame update void Start() { } private void OnEnable() { _startButton.onClick.AddListener(ButtonEvent); } // Update is called once per frame void Update() { } private void OnDisable() { _startButton.onClick.RemoveListener(ButtonEvent); } void ButtonEvent() { MainPanel.ins.OpenLevelPanel(); } }