Skip to content

Instantly share code, notes, and snippets.

@mousedoc
Last active July 16, 2020 06:22
Show Gist options
  • Save mousedoc/7782009a7ccf687e7dfcbbfcb8d84b88 to your computer and use it in GitHub Desktop.
Save mousedoc/7782009a7ccf687e7dfcbbfcb8d84b88 to your computer and use it in GitHub Desktop.
UnityEngine.Font extension
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)
return;
Resources.UnloadAsset(font);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment