public void LoadScene(string sceneName)
 {
     if (sceneName != null)
     {
         m_currentSceneName = sceneName;
         OnLoadStart?.Invoke(sceneName);
         PhotonNetwork.LoadLevel(m_currentSceneName);
         OnLoadEnd?.Invoke(sceneName);
     }
 }
Example #2
0
        /// <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;
            }
        }