public void MakeMoney() { if (slotstt == SlotState.HaveNoMoney) { slotstt = SlotState.HaveMoney; tray.PlaceDeck(gameObject.transform, moneyType); } numberOfMoney += 1; if (numberOfMoney <= 5) { moneys[numberOfMoney - 1] = pool.Spawn("MoneyT" + slotPrice.ToString(), transform); moneys[numberOfMoney - 1].localScale = new Vector3(960f, 960f, 1f); moneys[numberOfMoney - 1].gameObject.GetComponent <TrayMoney>().SortingImgInDeck(numberOfMoney); //sorting image. PlaceMoney(); } tray.AddToValueOnTray(localizedSlotPrice); }