Can someone help me with this i can see the error?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class AutoEaterBuy : MonoBehaviour
{
public GameObject FakeButton;
public GameObject FakeText;
public GameObject RealButton;
public GameObject RealText;
public static int CurrentDollars;
public static int AutoEaterValue = 20;
public static bool TurnOffButton = false;
public GameObject AutoEaterStats;
public static int NumberOfAutoEater;
public static int AutoEaterPerSec;
void Update()
{
CurrentDollars = Dollars.dollars;
AutoEaterStats.GetComponent().text = "Auto Eaters: " + NumberOfAutoEater + " @ " + AutoEaterPerSec + " Per Second";
FakeText.GetComponent().text = "Auto eater - $" + AutoEaterValue;
RealText.GetComponent().text = "Auto eater - $" + AutoEaterValue;
if (CurrentDollars >= AutoEaterValue)
{
FakeButton.SetActive(false);
RealButton.SetActive(true);
}
if (TurnOffButton == true)
{
RealButton.SetActive(false);
FakeButton.SetActive(true);
TurnOffButton = false;
}
}
}
↧