private void Start() { //Get data from save SavingAndLoading.instance.LoadGame(); UIM = UIManager.instance; //Update the UI UIM.UpdateMoney(money); UIM.UpdateLooseChange(looseChange); UIM.UpdateMoneyPerClick(moneyPerClick); UIM.UpdateAutoClicks(numAutoClicks); //Start automators running StartCoroutine(Automators()); //Check if the player has played the game yet today currentDate = DateTime.Today; if (currentDate.Date > lastDatePlayed.Date) { collectedDailyReward = false; lastDatePlayed = currentDate; prestigeScore = NumberHandler.IncreaseNumber(prestigeScore, prestigeScorePlayedADayEffect.ToString()); } //Let the player know to collect their daily reward if they haven't yet if (!collectedDailyReward) { notificationPanel.SetActive(true); } }
//Make the button show how much the item costs (including multipliers if it's being bought in bulk) public void UpdateBuyButton() { switch (itemType) { case ItemTypes.AUTOMATOR: string automatorCost = thisAutomator.cost; for (int i = 0; i < costMultiplier - 1; i++) { automatorCost = NumberHandler.IncreaseNumber(automatorCost, thisAutomator.cost); } cost.text = automatorCost; totalCost = automatorCost; break; case ItemTypes.ACCELERATOR: string acceleratorCost = thisAccelerator.cost; for (int i = 0; i < costMultiplier - 1; i++) { acceleratorCost = NumberHandler.IncreaseNumber(acceleratorCost, thisAccelerator.cost); } cost.text = acceleratorCost; totalCost = acceleratorCost; break; } }
//Make each autoClick earn the user money on a timer public IEnumerator Automators() { for (int i = 0; i < numAutoClicks; i++) { money = NumberHandler.IncreaseNumber(money, moneyPerClick); } UIM.UpdateMoney(money); yield return(new WaitForSeconds(timeBetweenAutoClicks)); StartCoroutine(Automators()); }
//Set the player's click and autoClicks to the upgrade amount //Reset all other variables (including purchases) //Update the UI public void Upgrade() { moneyPerClick = GetUpgradeStartClick().ToString(); numAutoClicks = GetUpgradeAutomators(); money = "0"; UIM.ResetPurchases(); UIM.UpdateMoneyPerClick(moneyPerClick); UIM.UpdateMoney(money); UIM.UpdateAutoClicks(numAutoClicks); prestigeScore = NumberHandler.IncreaseNumber(prestigeScore, moneyPerClick); prestigeScore = NumberHandler.IncreaseNumber(prestigeScore, numAutoClicks.ToString()); }
public void AddAutoClick(int amount) { prestigeScore = NumberHandler.IncreaseNumber(prestigeScore, (amount * 100).ToString()); numAutoClicks += amount; UIM.UpdateAutoClicks(numAutoClicks); }
public void AddMoneyPerClick(string amount) { moneyPerClick = NumberHandler.IncreaseNumber(moneyPerClick, amount); prestigeScore = NumberHandler.IncreaseNumber(prestigeScore, amount); UIM.UpdateMoneyPerClick(moneyPerClick); }
public void IncreaseLooseChange(int add) { looseChange = NumberHandler.IncreaseNumber(looseChange, add.ToString()); prestigeScore = NumberHandler.IncreaseNumber(prestigeScore, add.ToString()); UIM.UpdateLooseChange(looseChange); }
public void IncreaseMoney(int add) { money = NumberHandler.IncreaseNumber(money, add.ToString()); prestigeScore = NumberHandler.IncreaseNumber(prestigeScore, add.ToString()); UIM.UpdateMoney(money); }
public void IncreaseMoney() { money = NumberHandler.IncreaseNumber(money, moneyPerClick); prestigeScore = NumberHandler.IncreaseNumber(prestigeScore, moneyPerClick); UIM.UpdateMoney(money); }