Advertisement
Guest User

load

a guest
Sep 9th, 2016
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.05 KB | None | 0 0
  1. public void soundLoad()
  2.     {
  3.         bool asd = true;
  4.         if (Application.platform == RuntimePlatform.Android)
  5.         {
  6.             string oriPath = System.IO.Path.Combine(Application.streamingAssetsPath, "soundSave.xml");
  7.  
  8.             WWW reader = new WWW(oriPath);
  9.             while (!reader.isDone) { Debug.Log("not"); }
  10.             Debug.Log("und www");
  11.  
  12.             StreamReader sr = new StreamReader(reader.text);
  13.             XmlDocument doc = new XmlDocument();
  14.             doc.Load(sr);
  15.             Debug.Log("und sr");
  16.  
  17.             XmlNodeList adds = doc.GetElementsByTagName("sound");
  18.             foreach (XmlNode add in adds)
  19.                 if (add.Attributes["music"].Name == "music")
  20.                 {
  21.                     musicSlider.value = float.Parse(add.Attributes["music"].Value);
  22.                     soundSlider.value = float.Parse(add.Attributes["sound"].Value);
  23.                     break;
  24.                 }
  25.             //doc.Save(filepath);
  26.  
  27.             Debug.Log(musicSlider.value + " | " + soundSlider.value);
  28.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement