IEnumerator Buying(Collider2D col) { StartCoroutine(CreateMessage(2)); yield return(new WaitForSeconds(2f)); ShopInfo Shopinfo = col.transform.GetComponentInParent <ShopInfo>(); int ranNum = UnityEngine.Random.Range(0, 100); if ((Shopinfo.OnSale)) { if (ranNum < 50) { isBuying = true; BuyIndex = Shopinfo.SaleItemID; BuyCost = GameData.ItemList[BuyIndex].Cost; Shopinfo.SoldOut(); StartCoroutine(BuyCounter(BuyIndex)); } else { isCollide = false; } } else { isCollide = false; } Shopinfo.isLook = false; StopCoroutine(Buying(col)); }