UILabel.OnFontTextureChanged C# (CSharp) Méthode

OnFontTextureChanged() static private méthode

Notification called when the Unity's font's texture gets rebuilt. Unity's font has a nice tendency to simply discard other characters when the texture's dimensions change. By requesting them inside the notification callback, we immediately force them back in. Originally I was subscribing each label to the font individually, but as it turned out mono's delegate system causes an insane amount of memory allocations when += or -= to a delegate. So... queue yet another work-around.
static private OnFontTextureChanged ( ) : void
Résultat void
	static void OnFontTextureChanged ()
	{
		for (int i = 0; i < mList.size; ++i)
		{
			UILabel lbl = mList[i];

			if (lbl != null)
			{
				Font fnt = lbl.trueTypeFont;

				if (fnt != null)
				{
					fnt.RequestCharactersInTexture(lbl.mText, lbl.mPrintedSize, lbl.mFontStyle);
					lbl.MarkAsChanged();
				}
			}
		}
	}
#endif