I have a gamemanager class in C# :
public class GameManager : MonoBehaviour
{
....
....
bool perdu = false;
public void aPerdu()
{
perdu = true;
Debug.Log("aPerdu "+perdu);
}
void Update()
{
Debug.Log("Update:" + perdu);
)
I call the function aPerdu() to set the boolean to true. Nowhere else in the code the boolean is set to a value (true or false).
In my trace i have a “aPerdu true” and in Update it keep stating that perdu is false. i do not understantd how can my aPerdu change scope is limited to the function.
This is something i done thousands of times in Java, how can c#/unity act differently? What am i doing wrong?
PS : Sorry for the missing closing brackets but alt gr + the key next to backspace (fr keyboard) generate a enter code here
instead of closing bracket