So I have this code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class JumpUpgrade : MonoBehaviour
{
private bool UpgradePressed;
private bool Upgraded = false;
private bool done;
void Start()
{
UpgradePressed = false;
done = false;
}
void Awake()
{
DontDestroyOnLoad(this.gameObject);
}
public void JumpMax(int JumpMax)
{
if (Upgraded == true)
{
JumpMax = JumpMax + 1;
Upgraded = false;
}
}
public void Coins(int Coins)
{
if (UpgradePressed == true)
{
if (Coins >= 10)
{
Coins = Coins - 10;
Debug.Log("Upgrade succesfull");
Upgraded = true;
done = true;
}
else
{
Debug.Log("not enough coins");
done = true;
}
}
else
{
Debug.Log("NOT TRUE, NOT TRUE");
done = true;
}
}
public void JumpUpgrade1()
{
UpgradePressed = true;
Debug.Log("click");
if (done == true)
{
Debug.Log("Done");
UpgradePressed = false;
done = false;
}
}
}
The problem is it will ONLY debug: Not true, Not true. And it debugs click if I click. Does someone spot the problem why it only debugs Not true and click?