public static void Enqueue(SceneLoadState scene)
        {
            NetLog.Debug("Loading {0} ({1})", scene, AscensionNetworkInternal.GetSceneName(scene.Scene.Index));

            delay = 0;
            LoadOps.AddLast(new LoadOp {
                scene = scene
            });
        }
        void Load()
        {
            // notify core of loading
            Core.SceneLoadBegin(LoadOps.First.scene);

            // load level
            SceneManager.LoadSceneAsync(AscensionNetworkInternal.GetSceneName(LoadOps.First.scene.Scene.Index));

            // we are done!
            Done();
        }
        void LoadAsync()
        {
            if (LoadOps.First.async == null)
            {
                // notify core of loading
                Core.SceneLoadBegin(LoadOps.First.scene);

                // begin new async load
                LoadOps.First.async = SceneManager.LoadSceneAsync(AscensionNetworkInternal.GetSceneName(LoadOps.First.scene.Scene.Index));
            }
            else
            {
                if (LoadOps.First.async.isDone)
                {
                    Done();
                }
            }
        }
Exemple #4
0
        /// <summary>
        /// Load a scene based on name, only possible on the Server
        /// </summary>
        /// <param name="scene">The scene to load</param>
        /// <param name="token">A data token from the server</param>
        public static void LoadScene(string scene, IMessageRider token)
        {
            VerifyIsRunning();

            int sceneIndex = -1;

            try
            {
                sceneIndex = AscensionNetworkInternal.GetSceneIndex(scene);
            }
            catch (Exception exn)
            {
                NetLog.Error("Exception thrown while trying to find index of scene '{0}'", scene);
                NetLog.Exception(exn);
                return;
            }

            Core.LoadScene(sceneIndex, token);
        }