using System.Collections;
using UnityEngine.Ui;
using UnityEngine;
public class Game : MonoBehaviour
{
public text ui;
public void Increment()
{
GameManager.Geld += GameManager.multiplier;
}
public void Buy(int num)
{
if(num == 1 && GameManager.Geld >= 25)
{
GameManager.multiplier += 1;
GameManager.Geld -= 25;
}
}
}
// Update is called once per frame
void Update()
{
ui.text = "Geld:" + GameManager.Geld;
}
Thats the first script where the error is in.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour
{
public static int Geld;
public static int multiplier;
void Start()
{
multiplier = 1;
Geld = 0;
}
}
Thats the second script there is no error in it but I think it helps you to understand the problem