////

        public void AdvanceScene(bool sync)
        {
            SceneID nextUid = this.CurrentScene.GetNextSceneId();

            if (nextUid != null)
            {
                this.SetCurrentScene_Internal(nextUid, sync);
            }
            else
            {
                CutsceneManager.Instance.EndCutscene(this.UniqueId, this.PlaysForWhom, sync);
            }
        }
        internal void SetCurrentSceneFromNetwork_Internal(SceneID uid, CutsceneUpdateProtocol netData, bool sync)
        {
            this.CurrentScene.EndScene_Internal(this);
            this.CurrentScene = this.CreateNextSceneFromNetwork(uid, netData);
            this.CurrentScene.BeginScene_Internal(this);

            if (sync)
            {
                if (Main.netMode == NetmodeID.Server)
                {
                    CutsceneUpdateProtocol.SendToClients(cutscene: this, ignoreWho: -1);
                }
                else if (Main.netMode == NetmodeID.MultiplayerClient)
                {
                    CutsceneUpdateProtocol.Broadcast(cutscene: this);
                }
            }
        }
예제 #3
0
        internal void BeginCutsceneFromNetwork_Internal(
            SceneID sceneId,
            CutsceneStartProtocol netData,
            Action <string> onSuccess,
            Action <string> onFail)
        {
            this.CurrentScene = this.CreateIntroSceneFromNetwork(netData);

            if (this.CurrentScene != null)
            {
                this.CurrentScene.BeginScene_Internal(this);
                onSuccess("Success.");
                return;
            }

            int retries = 0;

            Timers.SetTimer(2, true, () => {
                this.CurrentScene = this.CreateIntroSceneFromNetwork(netData);

                if (this.CurrentScene == null)
                {
                    if (retries++ < 1000)
                    {
                        return(true);
                    }
                    else
                    {
                        onFail("Timed out.");
                        return(false);
                    }
                }

                this.CurrentScene.BeginScene_Internal(this);

                onSuccess("Success.");
                return(false);
            });
        }
예제 #4
0
 protected abstract SceneBase CreateNextSceneFromNetwork(SceneID sceneId, CutsceneUpdateProtocol data);
예제 #5
0
 protected abstract SceneBase CreateNextScene(SceneID sceneId);