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