void SellPen(BunnyPenData pen) { pen.ResetVariables(); SoundEffectsPlayer.Instance.PlaySound("kaching"); uint sellAmount = (uint)Mathf.RoundToInt(Random.Range(m_sellAmount.minValue, m_sellAmount.maxValue)); EffectCanvas.Instance.HelperText("A bunny in a pen has been sold for $" + sellAmount.ToString()); m_inventory.m_money += sellAmount; m_moneyText.text = "Coins: " + m_inventory.m_money; }
void SellABunny() { // Sell last pen if (m_filledList.Count < 2) { m_pensStillLeft = false; SellPen(m_filledList[0]); } int index = Random.Range(0, m_filledList.Count); m_nextSellTime = Time.time + Random.Range(m_timeToSell.minValue, m_timeToSell.maxValue); BunnyPenData pen = m_filledList[index]; m_filledList.Remove(pen); SellPen(pen); }