private void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } SceneManager.sceneLoaded += OnSceneLoaded; }
private void Awake() { _sceneLoadingHandler = SceneLoadingHandler.Instance; //singleton pattern a la Unity if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }