/// <summary> /// Stop writing text. /// </summary> /// private void Awake() { if (targetTextObject == null) { DebugHandler.LogError("targetTextObject NULL"); return; } textUI = targetTextObject.GetComponent <Text>(); inputField = targetTextObject.GetComponent <InputField>(); textMesh = targetTextObject.GetComponent <TextMesh>(); m_textMesh_Pro = targetTextObject.GetComponent <TextMeshProUGUI>(); if (textUI == null && inputField == null && textMesh == null && m_textMesh_Pro == null) { DebugHandler.LogError("Text NULL"); return; } // Cache the list of child writer listeners writerListeners.Clear(); var allComponents = GetComponentsInChildren <Component>(); for (int i = 0; i < allComponents.Length; i++) { var component = allComponents[i]; IWriterListener writerListener = component as IWriterListener; if (writerListener != null) { writerListeners.Add(writerListener); } } CacheHiddenColorStrings(); }
protected virtual void Awake() { GameObject go = targetTextObject; if (go == null) { go = gameObject; } textAdapter.InitFromGameObject(go); // Cache the list of child writer listeners var allComponents = GetComponentsInChildren <Component>(); for (int i = 0; i < allComponents.Length; i++) { var component = allComponents[i]; IWriterListener writerListener = component as IWriterListener; if (writerListener != null) { writerListeners.Add(writerListener); } } CacheHiddenColorStrings(); }
public void save(string newFilename, bool updateMaxStack, IWriterListener writerListener) { var writerParams = new WriterParameters() { UpdateMaxStack = updateMaxStack, WriterListener = writerListener, }; module.Write(newFilename, writerParams); }
protected virtual void Awake() { GameObject go = targetTextObject; if (go == null) { go = gameObject; } textUI = go.GetComponent <Text>(); inputField = go.GetComponent <InputField>(); textMesh = go.GetComponent <TextMesh>(); // Try to find any component with a text property if (textUI == null && inputField == null && textMesh == null) { var allcomponents = go.GetComponents <Component>(); for (int i = 0; i < allcomponents.Length; i++) { var c = allcomponents[i]; textProperty = c.GetType().GetProperty("text"); if (textProperty != null) { textComponent = c; break; } } } // Cache the list of child writer listeners var allComponents = GetComponentsInChildren <Component>(); for (int i = 0; i < allComponents.Length; i++) { var component = allComponents[i]; IWriterListener writerListener = component as IWriterListener; if (writerListener != null) { writerListeners.Add(writerListener); } } CacheHiddenColorStrings(); }
protected virtual void Awake() { GameObject go = targetTextObject; if (go == null) { go = gameObject; } textUI = go.GetComponent <Text>(); inputField = go.GetComponent <InputField>(); textMesh = go.GetComponent <TextMesh>(); // Cache the list of child writer listeners foreach (Component component in GetComponentsInChildren <Component>()) { IWriterListener writerListener = component as IWriterListener; if (writerListener != null) { writerListeners.Add(writerListener); } } }
protected virtual void Awake() { GameObject go = targetTextObject; if (go == null) { go = gameObject; } textUI = go.GetComponent <Text>(); inputField = go.GetComponent <InputField>(); textMesh = go.GetComponent <TextMesh>(); // Try to find any component with a text property if (textUI == null && inputField == null && textMesh == null) { foreach (Component c in go.GetComponents <Component>()) { textProperty = c.GetType().GetProperty("text"); if (textProperty != null) { textComponent = c; break; } } } // Cache the list of child writer listeners foreach (Component component in GetComponentsInChildren <Component>()) { IWriterListener writerListener = component as IWriterListener; if (writerListener != null) { writerListeners.Add(writerListener); } } }
public void Attach(IWriterListener listener) { writerListeners.Add(listener); }