T
T
timonestudio2021-04-25 16:05:11
C++ / C#
timonestudio, 2021-04-25 16:05:11

PlayerPrefs and increment how to do?

I have a script

void Start()
{
  PlayerPrefs.GetInt("money");
  PlayerPrefs.GetInt("food");
}
void OnClick()
{
  PlayerPrefs.GetInt("money") -- 26;
  PlayerPrefs.GetInt("food")++;
}

Why does not work and how to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2021-04-25
@timonestudio

Because it is necessary to use GET / SET.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question