private void AddDestroyShowShop(Transform pile, bool destroy) { foreach (Transform t in pile) { if (destroy) { ShowShopCard ssc = t.gameObject.GetComponent <ShowShopCard>(); Destroy(ssc); } else { t.gameObject.AddComponent <ShowShopCard>(); } } }
private void EnableShop() { GameManager.Instance.shopButton.interactable = true; foreach (Transform t in GameManager.Instance.warriorShopPile) { ShowShopCard ssc = t.GetComponent <ShowShopCard>(); if (ssc) { Destroy(ssc); } } foreach (Transform t in GameManager.Instance.rogueShopPile) { ShowShopCard ssc = t.GetComponent <ShowShopCard>(); if (ssc) { Destroy(ssc); } } foreach (Transform t in GameManager.Instance.mageShopPile) { ShowShopCard ssc = t.GetComponent <ShowShopCard>(); if (ssc) { Destroy(ssc); } } foreach (Transform t in GameManager.Instance.essentialsPile) { ShowShopCard ssc = t.GetComponent <ShowShopCard>(); if (ssc) { Destroy(ssc); } } GameManager.Instance.changeButton.interactable = false; ButtonDelay(); }
private void DisableShop() { GameManager.Instance.IsEffect = true; GameManager.Instance.shop.gameObject.SetActive(true); GameManager.Instance.buyButton.interactable = false; GameManager.Instance.exitShopButton.interactable = false; GameManager.Instance.shop.gameObject.GetComponent <ShopController>().Card = gameObject; foreach (Transform t in GameManager.Instance.essentialsPile) { ShowShopCard ssc = t.gameObject.GetComponent <ShowShopCard>(); if (ssc) { Destroy(ssc); } } }