public void LoadScene(string sceneName) { if (sceneName != null) { m_currentSceneName = sceneName; OnLoadStart?.Invoke(sceneName); PhotonNetwork.LoadLevel(m_currentSceneName); OnLoadEnd?.Invoke(sceneName); } }
/// <summary> /// Loader starts /// </summary> protected virtual void LoaderStart() { this.Data = null; this.State = netLoaderState.Starting; try { // never ever change order of event invokes! OnLoadStart?.Invoke(this); CallbackObserver?.OnLoadStart(this); } catch (Exception ex) { // this is only the exception handling for the event invoke not for the loader itself! Debug.WriteLine(ex); // ToDo: logging interface } finally { this.State = netLoaderState.Running; } }