I am making a game about planes and I having some problem with inheritance
First I have created varible called “YükseltmeHakkı” (UPGRADING RIGHT):
using UnityEngine.UI;
public class UpgradeRemainder : MonoBehaviour {
public int YükseltmeHakkı;
public void Update () {
YükseltmeHakkıText.text = "Kalan yükseltme hakları: " + YükseltmeHakkı;
}
Then I called this variable from anaother script in this function:
public void UpgradeDamage()
{
if(upgradeRemainder.YükseltmeHakkı > 0)
{
Damage += 5;
upgradeRemainder.YükseltmeHakkı--;
}
Normally,this code supposed to work when I presssed the button (decrease YükseltmeHakkı). But when I pressed the button that script is assigned to it does nothing (even when YükseltmeHakkı is bigger than 0).
Why could this be happening and how could I overcome this problem please help.