private IEnumerator EnemyTurnAI() { //Disable all buttons GameManager.Instance.ActiveHero(true).AttackButton.Find("AttackIcon").GetComponent <Button>().interactable = false; GameManager.Instance.endButton.interactable = false; GameManager.Instance.enemyDiscardPileButton.interactable = false; yield return(new WaitForSeconds(1f)); //Add PlayCard to Enemy's hand Transform hand = GameManager.Instance.GetActiveHand(true); foreach (Transform t in hand) { t.gameObject.AddComponent <PlayCard>(); } yield return(new WaitForSeconds(2.5f)); //Play Cards hand.GetChild(0).GetComponent <PlayCard>().PlayItem(); yield return(new WaitForSeconds(2f)); hand.GetChild(0).GetComponent <PlayCard>().PlayItem(); yield return(new WaitForSeconds(2f)); hand.GetChild(hand.childCount - 1).GetComponent <PlayCard>().PlayMinion(); yield return(new WaitForSeconds(2f)); //Remove Card Back GameManager.Instance.GetActiveMinionZone(true).GetChild(0).Find("CardBack").gameObject.SetActive(false); //Destroy Play Card foreach (Transform t in hand) { PlayCard pc = t.gameObject.GetComponent <PlayCard>(); if (pc) { Destroy(pc); } } //Open Shop GameManager.Instance.shop.gameObject.SetActive(true); yield return(new WaitForSeconds(2f)); ShopController shop = GameManager.Instance.shop.GetComponent <ShopController>(); GameObject card = GameManager.Instance.warriorShopPile.GetChild(2).gameObject; shop.UpdateShopCard(card); yield return(new WaitForSeconds(2f)); StartGameController.Instance.tutorial = false; shop.BuyCard(); yield return(new WaitForSeconds(2f)); card = GameManager.Instance.warriorShopPile.GetChild(2).gameObject; shop.UpdateShopCard(card); yield return(new WaitForSeconds(2f)); shop.BuyCard(); yield return(new WaitForSeconds(2f)); StartGameController.Instance.tutorial = true; GameManager.Instance.shop.gameObject.SetActive(false); yield return(new WaitForSeconds(2f)); GameManager.Instance.EndTurn(); yield return(new WaitForSeconds(2f)); ShowUI(); //Disable Player's Buttons GameManager.Instance.ActiveHero(true).AttackButton.Find("AttackIcon").GetComponent <Button>().interactable = false; GameManager.Instance.endButton.interactable = false; GameManager.Instance.shopButton.interactable = false; GameManager.Instance.allyDiscardPileButton.interactable = false; }