// ================================================================================================================ // MAIN EVENT INTERFACE ------------------------------------------------------------------------------------------- void Start() { var valueList = new ValueList(name); valueList.SetFromJSON(File.ReadAllText(filename)); //Debug.Log("====> " + ValueList.getInstance().GetString("language.systems.hepburn")); }
private List <ValueList> valueLists; // Valid value lists, already filtered and ordered // TODO: add tester interface. You can enter an ID, and it shows the selected value, and where it's coming from. Also add a simulator? // TODO: add a "comparer", so two language xmls can be compared and the missing ids can be listed. // TODO: create a better inspector? http://answers.unity3d.com/questions/26207/how-can-i-recreate-the-array-inspector-element-for.html // ================================================================================================================ // MAIN EVENT INTERFACE ------------------------------------------------------------------------------------------- void Awake() { // Load all value lists, creating a pre-filtered list valueLists = new List <ValueList>(); for (var i = 0; i < valueListsWithQualifiers.Length; i++) { // Filter if (doQualifiersApply(valueListsWithQualifiers[i])) { // Is valid, load var valueList = new ValueList("values_" + key + "_" + i); valueList.SetFromJSON(File.ReadAllText(valueListsWithQualifiers[i].fileName)); valueLists.Add(valueList); } } // Add to the list of instances that can be retrieved later ValueListManager.addInstance(this); Debug.Log("Value lists read; current language is " + ValueListManager.GetInstance().GetString("generic.language")); }
// ================================================================================================================ // MAIN EVENT INTERFACE ------------------------------------------------------------------------------------------- void Start() { var valueList = new ValueList(name); valueList.SetFromJSON(File.ReadAllText(filename)); //Debug.Log("====> " + ValueList.getInstance().GetString("language.systems.hepburn")); }