Skip to content

Instantly share code, notes, and snippets.

@mousedoc
Last active July 16, 2020 06:22
Show Gist options
  • Select an option

  • Save mousedoc/7782009a7ccf687e7dfcbbfcb8d84b88 to your computer and use it in GitHub Desktop.

Select an option

Save mousedoc/7782009a7ccf687e7dfcbbfcb8d84b88 to your computer and use it in GitHub Desktop.

Revisions

  1. mousedoc revised this gist Jul 16, 2020. No changes.
  2. mousedoc revised this gist Jul 16, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions FontExtension.cs
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    public static class FontExtension
    {
    // Call it when the type of the string assigned to the global Text component is minimal.
    // XXX : If font is in AssetBundle, it may not work correctly.
    public static void RefreshDynamicTexture(this Font font)
    {
    if (font == null || font.dynamic == false)
  3. mousedoc created this gist Jul 16, 2020.
    10 changes: 10 additions & 0 deletions FontExtension.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    public static class FontExtension
    {
    public static void RefreshDynamicTexture(this Font font)
    {
    if (font == null || font.dynamic == false)
    return;

    Resources.UnloadAsset(font);
    }
    }