private void CreateTextMesh() { GameObject go = ResourceManager.CreateInstance<GameObject>("TextMesh"); if(go == null){ EditorDebug.LogError("No GameObject found for TextMesh on Object "+ this.gameObject.name + "! Stop!"); return; } textComponent = go.GetComponent<GUITextPlane>() as GUITextPlane; if(textComponent == null){ EditorDebug.LogError("No TextMesh found on Object "+ this.gameObject.name + "! Stop!"); return; } }
private void CreateTextMesh() { GameObject go = ResourceManager.CreateInstance<GameObject>("TextMesh"); if(go == null){ EditorDebug.LogError("No GameObject found for TextMesh on Object "+ this.gameObject.name + "! Stop!"); return; } textComponent = go.GetComponent<GUITextPlane>() as GUITextPlane; if(textComponent == null){ EditorDebug.LogError("No TextMesh found on Object "+ this.gameObject.name + "! Stop!"); return; } go.name = gameObject.name + "_Text"; textComponent.GUIMaterial = activeScreen.TextMaterial; textComponent.FontType = FontType; }