public void ExitToMenu() { gameDat gameData = ((GameObject)Resources.Load("gameDat")).GetComponent <gameDat>(); gameData.time = 0; gameData.deaths = 0; SceneManager.LoadScene("StartMenu"); }
// Use this for initialization void Start() { gameData = ((GameObject)Resources.Load("gameDat")).GetComponent <gameDat>(); }