void GetBestScore(string path) { float bestScore = 0; XmlDocument xDoc = new XmlDocument(); xDoc.Load(path); XmlElement xRoot = xDoc.DocumentElement; foreach (XmlNode xnode in xRoot) { foreach (XmlNode childnode in xnode.ChildNodes) { if (childnode.Name == "score") { float score = float.Parse(childnode.InnerText); if (score > bestScore) { bestScore = score; } } } } this.bestScore.text = bestScore.ToString(); }
public void LoadPreviousScene() { currentScene--; if (currentScene < 0) { currentScene = 0; } sceneNo.text = sceneNo.ToString(); SceneManager.LoadScene(currentScene); }