YAML to C# with Yaml.net for Unity -


i making game have file full of strings , different translations inside of yaml file.

here example of looks like.

en:     player:          hello: hello         thanks:     enemy:          hello: hello es:     player:         hello: hola         thanks: gracias     enemy:          hello: hola 

as can see, have 3 nested dictionaries. first shows language - en, es, cn, or whatever national prefix. next, have list of dictionaries character names. these can player bob. lastly, each character has list of dictionary of lines.

i using yaml.net (a version unity - using seems no different normal).

here's example of how objects laid out.

class translation {     public dictionary<string, language> language { get; set; } }  class language {     public dictionary<string, character> character { get; set; } }  class character {     public dictionary<string, line> line; }  class line {     public string text { get; set; } } 

however, doesn't work since compiler complains en , es not properties of translation class. how can solve problem without specifying every individual country code or character name?


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -