/// <summary> /// Loads in a string resource from XML as a set of strings /// </summary> /// <param name="resource">String Resource name (name in the path after the language code)</param> public void LoadText(string resource) { Destroy(textWriterObject); StringsLoader loader = new StringsLoader(); loader.Load(resource); if (loader.Value != null) { // This probably isn't very efficient texts = new Stack <string>(loader.Value.Values.Reverse().ToList()); } }
public void ShowDialog(string xml) { var existing = FindObjectOfType <TextWriterComponent>(); if (!UnityUtils.Exists(existing)) { var textWriterQueuePrefab = GetRequiredResource <GameObject>("Prefabs/UI/TextWriterQueue"); var stringLoader = new StringsLoader(); stringLoader.Load(xml); var textWriterQueueInstance = Instantiate(textWriterQueuePrefab, FindOrCreateCanvas().transform); var textQueueComp = GetRequiredComponent <TextWriterQueueComponent>(textWriterQueueInstance); textQueueComp.InitQueue(new Queue <string>(stringLoader.Value.Values)); } }
private void ReloadStrings() { if (stringsLoader == null) { stringsLoader = new StringsLoader(); } // Using keyboard so load the keyboard strings if (activeInputListenerType == typeof(KeyboardInputListener)) { stringsLoader.Load("Global/tutorialMessagesKeyboard.xml"); } else { stringsLoader.Load("Global/tutorialMessagesXbone.xml"); } }