public void FinishedStep(Stepper stepper) { if (!_monsterSpawned) { SpawnMonster(); } if (stepper.acceptsInput) { // check if we've reached the edge of the screen Vector3 viewPos = playerCamera.WorldToViewportPoint(playerObject.transform.position); if (viewPos.x > 0.9f) { // end game in victory for player Debug.Log("Player has won the game!"); GameManager.Instance.GameEnding(Time.time);//, true, "You made it! Well done!"); // play animations playerStepper.Win(); AS_back.mute = true; AS_monster.mute = true; AS_win.Play(); if (GameManager.Instance.endTime - GameManager.Instance.startTime > UIManager.Instance.popPopHighScores[UIManager.Instance.currentDifficulty]) { newRecord = true; } if (newRecord) { //UIManager.Instance.popPopHighScores[UIManager.Instance.currentDifficulty] = GameManager.Instance.endTime - GameManager.Instance.startTime; //UIManager.Instance.UpdateTopResultTexts(); } } } }