Last active
November 10, 2015 15:34
-
-
Save kama2vern/9f995a8103c0d5cdb382 to your computer and use it in GitHub Desktop.
Yaml parse source
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class DictionaryDeserializer { | |
public Dictionary<string, Header> dictionary { get; set; } | |
public class Header { | |
public string name { get; set; } | |
public string type { get; set; } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StreamReader sr = new StreamReader ("Assets/test.yaml"); | |
string text = sr.ReadToEnd (); | |
var input = new StringReader (text); | |
var deserializer = new Deserializer (namingConvention: new CamelCaseNamingConvention ()); | |
DictionaryDeserializer deserializeObject = deserializer.Deserialize<DictionaryDeserializer>(input); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dictionary: | |
header_1: | |
name: one | |
type: header | |
header_2: | |
name: two | |
type: header |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
error