private void UpdateGlyphs() { clearChildren(); if (parameter.Fontname.Length > 4) { if (Is3D()) { if (null == m_fontInfo) { m_fontInfo = new VFontInfo(parameter.Fontname); } m_fontInfo.CreateText3D(this, RenderText); } else { // use common fontinfo VFontInfo fi = VFontHash.GetFontInfo(parameter.Fontname); fi.CreateText3D(this, RenderText); } if (null != m_changeListener) { foreach (MonoBehaviour mb in m_changeListener) { mb.SendMessage("VTextChanged"); } } } }
private void UpdateLayout() { if (this == null) { return; } // Debug.Log("ug " + parameter.fontname); if (parameter.Fontname.Length > 4) { if (Is3D()) { if (null != m_fontInfo) { m_fontInfo.LayoutText3D(this, RenderText); } } else { // use common fontinfo VFontInfo fi = VFontHash.GetFontInfo(parameter.Fontname); if (null != fi) { fi.LayoutText3D(this, RenderText); } } } }
void OnEnable() { if (gameObject.activeInHierarchy) { m_oldText = ""; m_fontInfo = null; // set default material var mat = new Material(Shader.Find("Standard")); if (materials[0] == null) { materials[0] = mat; } if (materials[1] == null) { materials[1] = mat; } if (materials[2] == null) { materials[2] = mat; } layout.CheckClearModified(); Physics.CheckClearModified(); AdditionalComponents.CheckClearModified(); } }
public void Rebuild() { if (null != m_fontInfo) { m_fontInfo = null; } UpdateGlyphs(); }
public void Rebuild(bool rebuildMesh = false) { if (this == null || !this.gameObject.activeInHierarchy) { return; } if (Loom.Current == null) { Loom.Initialize(); } if (null != m_fontInfo) { m_fontInfo.Shutdown(); m_fontInfo = null; } UpdateGlyphs(rebuildMesh); UpdatePhysics(); UpdateAdditionalComponents(); }
private void UpdateGlyphs(bool updateGeometry = false) { if (this == null) { return; } clearChildren(); if (parameter.Fontname.Length > 4) { if (Is3D()) { if (null == m_fontInfo) { m_fontInfo = new VFontInfo(parameter.Fontname); } if (null == m_fontInfo) { Debug.Log("Null fontinfo"); } else { m_fontInfo.SetQuality(parameter.Quality); m_fontInfo.CreateText3D(this, RenderText); } } else { // use common fontinfo if (!updateGeometry) { VFontInfo fi = VFontHash.GetFontInfo(parameter.Fontname); fi.SetQuality(parameter.Quality); fi.CreateText3D(this, RenderText); } else { // Debug.Log("Update geo"); // VFontInfo fi = VFontHash.GetFontInfo(parameter.Fontname); if (null == m_fontInfo) { m_fontInfo = new VFontInfo(parameter.Fontname); } if (null == m_fontInfo) { Debug.Log("Null fontinfo"); } else { m_fontInfo.SetQuality(parameter.Quality); m_fontInfo.CreateText3D(this, RenderText); } } } if (null != m_changeListener) { foreach (MonoBehaviour mb in m_changeListener) { mb.SendMessage("VTextChanged"); } } } }