Beispiel #1
0
        public void Serialize()
        {
            var path            = System.IO.Path.Combine(Environment.CurrentDirectory, "Dialogue.json");
            var newTree         = new DialogueTree();
            var dialogue_string = JsonConvert.SerializeObject(newTree);

            System.IO.File.WriteAllText(path, dialogue_string);
            DialogueTree dialogue_tree = JsonConvert.DeserializeObject <DialogueTree>(dialogue_string);
        }
 static void Main(string[] args)
 {
     #region
     //var path = System.IO.Path.Combine(Environment.CurrentDirectory, "stats.txt");
     //var stats = new Stats();
     //var stat_string = JsonConvert.SerializeObject(stats);
     //System.IO.File.WriteAllText(path, stat_string);
     #endregion
     var path    = System.IO.Path.Combine(Environment.CurrentDirectory, "Sample.json");
     var newTree = new DialogueTree();
     newTree.Dialogue();
     var dialogue_root = JsonConvert.SerializeObject(newTree);
     System.IO.File.WriteAllText(path, dialogue_root);
 }