public void CheckState() { stateTracker = GameObject.FindGameObjectWithTag("Player").GetComponent <GamestateTracker>(); if (stateTracker != null) { stateTracker.Updatestep(); } }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Space) && button.activeSelf) { foreach (int i in triggerSteps) { if (i == gamestate.Gamestep) { gamestate.Gamestep++; gamestate.Updatestep(); print(gamestate.Gamestep); //print(Items.itemName); break; } } } }