using Code.GameplayServices; using UnityEngine; using UnityEngine.UI; namespace Code.UI { public class StartGamePanel : MonoBehaviour { [SerializeField] private Button startGameButton; private void Awake() { startGameButton.onClick.AddListener(RestartGame); } private void RestartGame() { GameplayManager.Instance.RestartGame(); gameObject.SetActive(false); } private void OnDestroy() { startGameButton.onClick.RemoveListener(RestartGame); } } }