Assets/TextExtensions.cs
/// <summary>
/// Updates the text of a 3D Text object, even from a non-UI thread.
/// </summary>
/// <param name="mesh">The text mesh to update.</param>
/// <param name="text">The new text to apply to the mesh.</param>
Updates the text of a 3D Text object, even from a non-UI thread.
Updates the text of a 3D Text object even from a non - UI thread .
public static void UpdateText(this TextMesh mesh, string text)
        {
            void updateTextHandler(object[] args) =>
                ((TextMesh)args[0]).text = args[1] as string;
            UIThread.Invoke(updateTextHandler, mesh, text);
        }
public static void UpdateText ( this TextMesh mesh , string text ) { void updateTextHandler ( object [ ] args ) => ( ( TextMesh ) args [ 0 ] ) . text = args [ 1 ] as string ; UIThread . Invoke ( updateTextHandler , mesh , text ) ; }
Updates the text of a 3D Text object, even from a non-UI thread.
Updates the text of a 3D Text object even from a non - UI thread .
// Text updates must occur on main UI thread
TextMesh
this
text
string
The new text to apply to the mesh.
The new text to apply to the mesh .
mesh
The text mesh to update.
The text mesh to update .