using System.Collections; using System.Collections.Generic; using UnityEngine; public abstract class Menu : Menu where T : Menu { private static T _instance; public static T Instance { get { return _instance; } } protected virtual void Awake() { if (_instance != null) { Destroy(gameObject); } else { _instance = (T)this; } } protected virtual void OnDestroy() { _instance = null; } public static void Open() { if(MenuManager.Instance != null && MainMenu.Instance != null) { MenuManager.Instance.OpenMenu(Instance); } } } public abstract class Menu : MonoBehaviour { public virtual void OnBackPressed() { audioController.Instance.PlaySFX("TombolUmum", 0.5f); MenuManager.Instance.CloseMenu(); } }