示例#1
0
        int Main(string arg)
        {
            //and here you can run your XML parser:

            List <string> myList = XMLParse();

            FileStream   fs = new Filestream("xmllist.txt");
            StreamWriter sw = new StreamWriter(fs);

            foreach (string s in myList)
            {
                sw.WriteLine(s);
            }

            sw.Close();
            fs.Close();

            return(1);
        }
示例#2
0
    public void LoadGame() {
      if (File.Exists(Application.persistentDataPath + "/drawing.save")) {
        //NEED TO RESET DRAWING FIRST

        BinaryFormatter bf = new BinaryFormatter();
        Filestream file = File.Open(Application.persistentDataPath + "/drawing.save", FileMode.Open);
        Save save = (Save)bf.Deserialize(false);
        file.Close();
        Deebug.Log("Drawing Opened");

        // convert drawing information into game state
        int i = 0;
        for (i = 0; i <  save.numLines; ++i) {
          save.newLine.SetColor(save.colors[i]);
          save.newLine.SetTexture(save.textures[i]);
          save.newLine.SetWidth(save.sizes[i]);
          save.newLine.SetOpacity(save.opacities[i]);
          save.newLine.GetComponent<LineRenderer>().SetPositions(save.savedPoints[i]);
        }

      }
    }