Пример #1
0
        /// <summary>
        /// 戦闘イベント処理
        /// </summary>
        /// <param name="subject"></param>
        /// <param name="dungeonEffectView"></param>
        private static void BattleEvent(AsyncSubject <Unit> subject, DungeonEffectView dungeonEffectView)
        {
            dungeonEffectView.OpenTransition().Subscribe(_ =>
            {
                var dungeon = GameObject.Find("Dungeon");
                dungeon.SetActive(false);
                //戦闘画面を立ち上げる
                GameSceneManager.BootBattle().Subscribe(loots =>
                {
                    dungeonEffectView.OpenTransition().Subscribe(___ =>
                    {
                        //戦闘画面を消す
                        GameSceneManager.EndBattle();
                        dungeon.SetActive(true);
                        dungeonEffectView.HideTransition().Subscribe(____ =>
                        {
                            //報酬ログを流す
                            List <string> texts = new List <string>();
                            loots.ForEach(loot =>
                            {
                                texts.Add(ItemDictionary.GetAnnounceText(loot));
                            });
                            AnnounceTextView.Instance.AddText(texts);

                            subject.OnNext(Unit.Default);
                            subject.OnCompleted();
                        });
                    });
                });
                dungeonEffectView.HideTransition();
            });
        }