Esempio n. 1
0
        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
            });
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        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();
                }
            }
        }
Esempio n. 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);
        }