public IEnumerator OpenArea(int[] newOpenAreaID) { bool Finished = false; for (int i = 0; i < newOpenAreaID.Length; i++) { Debug.Log("OpenArea"); Prefab_AreaOpenAnimation = Resources.Load <GameObject>("Prefabs/StrategyPrefab/StrategyTop/AreaEnterAnimation"); yield return(StartCoroutine(Util.WaitEndOfFrames(3))); mapCamera.MoveToTargetTile(newOpenAreaID[i]); yield return(new WaitForSeconds(0.5f)); tileManager.Tiles[newOpenAreaID[i]].SetVisibleDockIcons(isVisible: false); tileManager.Tiles[newOpenAreaID[i]].PlayAreaOpenAnimation(Prefab_AreaOpenAnimation, delegate { Finished = true; }); while (!Finished) { yield return(new WaitForEndOfFrame()); } tileManager.Tiles[newOpenAreaID[i]].UpdateDockIcons(); tileManager.Tiles[newOpenAreaID[i]].SetVisibleDockIcons(isVisible: true); if (newOpenAreaID[i] == 17) { Red_Sea.SetActive(true); TweenAlpha.Begin(Red_Sea, 3f, 1f); SoundUtils.PlaySE(SEFIleInfos.SE_041); yield return(new WaitForSeconds(4f)); } TrophyUtil.Unlock_ReOpenMap(); Finished = false; } yield return(new WaitForEndOfFrame()); mapCamera.MoveToTargetTile(SingletonMonoBehaviour <AppInformation> .Instance.CurrentAreaID); yield return(new WaitForSeconds(0.5f)); List <int> openAreaID = new List <int>(); makeOpenAreaIdArray(openAreaID); tileRouteManager.UpdateTileRouteState(openAreaID); sailKeyController.setEnableIndex(openAreaID.ToArray()); Resources.UnloadAsset(Prefab_AreaOpenAnimation.GetComponent <UISprite>().atlas.spriteMaterial.mainTexture); yield return(new WaitForEndOfFrame()); yield return(null); }