public override IEnumerator Run() { if ("Dungeon" == SceneManager.GetActiveScene().name) { AsyncOperation operation = SceneManager.LoadSceneAsync("Common", LoadSceneMode.Additive); while (false == operation.isDone) { // loading progress yield return(null); } yield return(StartCoroutine(GameManager.Instance.Init())); } log = UIUtil.FindChild <UILog>(transform, "UI/UILog"); log.gameObject.SetActive(true); dungeon = UIUtil.FindChild <Dungeon>(transform, "Dungeon"); dungeon.gameObject.SetActive(true); dungeon_move = UIUtil.FindChild <DungeonMove>(transform, "Dungeon"); battle = UIUtil.FindChild <DungeonBattle>(transform, "Battle"); battle.gameObject.SetActive(false); ui_inventory = UIUtil.FindChild <UIInventory>(transform, "UI/UIInventory"); ui_inventory.gameObject.SetActive(false); ui_inventory.Init(); inventory_button = UIUtil.FindChild <Button>(transform, "UI/Dungeon/SideButtons/InventoryButton"); inventory_button.onClick.AddListener(() => { ui_inventory.gameObject.SetActive(true); Util.EventSystem.Publish(EventID.Dungeon_Monster_Reveal); }); text_inventory = UIUtil.FindChild <Text>(transform, "UI/Dungeon/SideButtons/InventoryButton/Text"); mini_map = UIUtil.FindChild <UIMiniMap>(transform, "UI/Dungeon/MiniMap"); mini_map.gameObject.SetActive(true); ui_player_transform = UIUtil.FindChild <Transform>(transform, "UI/Player"); ui_player_transform.gameObject.SetActive(true); player_health = UIUtil.FindChild <UIGaugeBar>(ui_player_transform, "Health"); player_exp = UIUtil.FindChild <UIGaugeBar>(ui_player_transform, "Exp"); ui_coin = UIUtil.FindChild <UICoin>(transform, "UI/Dungeon/UICoin"); ui_coin.gameObject.SetActive(true); { Image image = UIUtil.FindChild <Image>(ui_coin.transform, "Image"); ui_coin_position = Camera.main.ScreenToWorldPoint( new Vector3(image.rectTransform.position.x, image.rectTransform.position.y, Camera.main.transform.position.z * -1.0f) ); } coin_spot = UIUtil.FindChild <Transform>(transform, "CoinSpot"); coin_spot.gameObject.SetActive(true); coin_prefab = UIUtil.FindChild <Coin>(transform, "Prefabs/Coin"); shop = UIUtil.FindChild <UIShop>(transform, "UI/UIShop"); Util.EventSystem.Subscribe <int>(EventID.Dungeon_Move, OnMove); Util.EventSystem.Subscribe(EventID.Dungeon_Exit_Unlock, () => { StartCoroutine(OnExitUnlock()); }); Util.EventSystem.Subscribe(EventID.Dungeon_Map_Reveal, () => { mini_map.RevealMap(); }); Util.EventSystem.Subscribe(EventID.Dungeon_Monster_Reveal, () => { mini_map.RevealMonster(); }); Util.EventSystem.Subscribe(EventID.Dungeon_Treasure_Reveal, () => { mini_map.RevealTreasure(); }); Util.EventSystem.Subscribe <Item>(EventID.Inventory_Add, OnItemAdd); Util.EventSystem.Subscribe <Item>(EventID.Inventory_Remove, OnItemRemove); Util.EventSystem.Subscribe(EventID.Player_Stat_Change, OnPlayerStatChange); Util.EventSystem.Subscribe <Quest>(EventID.Quest_Start, OnQuestStart); Util.EventSystem.Subscribe <Quest>(EventID.Quest_Complete, OnQuestComplete); AudioManager.Instance.Play(AudioManager.DUNGEON_BGM, true); InitScene(); }