Im new to this and am trying to create an idle game following a youtube tutorial
this certain episode he went all over the place and i kind of got stuck. Im getting the error mentioned in the title here is the code if you can help it would mean a lot.
Controller.cs
using UnityEngine;
using TMPro;
public class Controller : MonoBehaviour
{
public UpgradeManager upgradeManager;
public Data data;
public TMP_Text GramText;
[SerializeField] private TMP_Text gramClickPowerText;
public BigDouble ClickPower()
{
return 1 + data.clickUpgradeLevel;
}
public void Start()
{
data = new Data();
upgradeManager.StartUpgradeManager();
}
public void Update()
{
GramText.text = data.Gram + " Gram";
gramClickPowerText.text = "+" + ClickPower() + " Gram Per Click";
}
public void GenerateDollars()
{
data.Gram += ClickPower();
}
}
Data
using UnityEngine;
public class Data
{
public double Gram;
public BigDouble clickUpgradeLevel;
public Data()
{
Gram = 0;
clickUpgradeLevel = 0;
}
}
UpgradeManager.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UpgradeManager : MonoBehaviour
{
public Controller controller;
public Data data;
public Upgrades clickUpgrade;
public string ClickUpgradeName;
public BigDouble clickUpgradeBaseCost;
public BigDouble clickUpgradeCostMult;
public void startUpgradeManager()
{
clickUpgradeName = "Gram Per Click";
clickUpgradeBaseCost = 10;
clickUpgradeCostMult = 1.5;
UpdateClickUpgradeUI();
}
public void UpdateClickUpgradeUI()
{
clickUpgrade.LevelText.text = controller.data.clickUpgradeLevel.ToString();
clickUpgrade.CostText.text = "Cost: " + cost() + " Gram";
clickUpgrade.NameText.text = "+1 " + clickUpgradeName;
}
public BigDouble cost()
{
return clickUpgradeBaseCost * BigDouble.Pow( clickUpgradeCostMult, controller.data.clickUpgradeLevel);
}
public void BuyUpgrade()
{
if (controller.data.gram > cost())
{
controller.data.gram -= cost();
controller.data.clickUpgradeLevel += 1;
}
UpdateClickUpgradeUI();
}
}