private IEnumerator OnReciveRewardDeck(Reward_Deck reward) { TrophyUtil.Unlock_DeckNum(); bool recived = false; UIGetRewardDialog rewardMateralsDialog = Util.Instantiate(mPrefabUIDutyRewardMaterialsDialog.gameObject, mModalCamera.gameObject).GetComponent <UIGetRewardDialog>(); rewardMateralsDialog.Initialize(reward); rewardMateralsDialog.SetOnDialogClosedCallBack(delegate { recived = true; rewardMateralsDialog.Close(); UnityEngine.Object.Destroy(rewardMateralsDialog.gameObject); }); KeyControl rewardDialogKeyController = rewardMateralsDialog.Show(); ChangeKeyController(rewardDialogKeyController); while (!recived) { yield return(new WaitForSeconds(0.5f)); } }