コード例 #1
0
        public virtual void StartScene(LoadingWriterSceneInfo data)
        {
            data.LoadingScreen?.Show();
            SignalBus.Fire <SceneChangedSignal>();

            var loading = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(ScenePath);

            loading.completed += (asyncOperation) => InitializeScene(data);
        }
コード例 #2
0
        protected virtual void InitializeScene(LoadingWriterSceneInfo data)
        {
            if (SceneManager <LoadingWriterSceneInfo> .Instance == null)
            {
                Debug.LogError("Started scene UI is not Writer.");
                return;
            }

            SceneManager <LoadingWriterSceneInfo> .Instance.Display(data);
        }
コード例 #3
0
        protected virtual void StartWriter(MenuSceneInfo sceneInfo, KeyValuePair <SaveType, EncounterMetadata> metadata)
        {
            if (metadata.Value == null)
            {
                return;
            }

            var encounter          = EncounterReader.GetEncounter(sceneInfo.User, metadata.Value, metadata.Key);
            var encounterSceneInfo = new LoadingWriterSceneInfo(sceneInfo.User, sceneInfo.LoadingScreen, encounter);

            SceneStarter.StartScene(encounterSceneInfo);
        }
コード例 #4
0
        public virtual void StartWriter()
        {
            var sceneInfo = SceneInfoSelectedListener.CurrentValue.SceneInfo;

            // Removes the table of contents tab
            // TODO: handle the ToC tab more elegantly
            if (sceneInfo.Encounter.Sections.Count > 0)
            {
                var firstSection = sceneInfo.Encounter.Sections[0].Value.Data;
                firstSection.Tabs.RemoveAt(0);
                if (firstSection.CurrentTabIndex > 0)
                {
                    firstSection.CurrentTabIndex--;
                }
            }

            var encounter       = new WaitableTask <Encounter>(sceneInfo.Encounter.Data);
            var writerSceneInfo = new LoadingWriterSceneInfo(sceneInfo.User, sceneInfo.LoadingScreen, encounter);

            WriterSceneStarter.StartScene(writerSceneInfo);
        }
 public LoadingWriterSceneInfoSelectedEventArgs(LoadingWriterSceneInfo sceneInfo) => SceneInfo = sceneInfo;