Last active
July 16, 2020 06:22
-
-
Save mousedoc/7782009a7ccf687e7dfcbbfcb8d84b88 to your computer and use it in GitHub Desktop.
UnityEngine.Font extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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