private bool isFontRebuilt = false;
private Font dirtyFont = null;
public void Awake ()
{
Font.textureRebuilt += delegate (Font font1)
{
isFontRebuilt = true;
dirtyFont = font1;
};
}
void LateUpdate()
{
if (isFontRebuilt)
{
isFontRebuilt = false;
foreach (Text text in GameObject.FindObjectsOfType<Text>())
{
if (text.font == dirtyFont)
{
text.FontTextureChanged();
}
}
TRACE.WarningLn("textureRebuilt:" + dirtyFont.name);
dirtyFont = null;
}
}