public void Update()
{
if (_texture == null)
{
_texture = new Texture2D(1, 1, TextureFormat.Alpha8, false);
_texture.hideFlags = HideFlags.HideInInspector | HideFlags.DontSave;
_texture.filterMode = FilterMode.Point;
_texture.wrapMode = TextureWrapMode.Clamp;
//Debug.Log("Texture2D creation: " + _texture.GetNativeTextureID());
}
int textureID = _texture.GetNativeTextureID();
SysFont.QueueTextureWithOptions(_text, FontName, _fontSize, _isBold,
_isItalic, _alignment, _isMultiLine, _maxWidthPixels,
_maxHeightPixels, (int)_lineBreakMode,
_fillColor.r, _fillColor.g, _fillColor.b, _fillColor.a,
_isStrokeEnabled, _strokeWidth, _strokeColor.r, _strokeColor.g, _strokeColor.b, _strokeColor.a,
_isShadowEnabled, _shadowOffset.x, _shadowOffset.y, _shadowColor.r, _shadowColor.g, _shadowColor.b, _shadowColor.a,
_lineSpacing, _offset, textureID);
_textWidthPixels = SysFont.GetTextWidth(textureID);
_textHeightPixels = SysFont.GetTextHeight(textureID);
_widthPixels = SysFont.GetTextureWidth(textureID);
_heightPixels = SysFont.GetTextureHeight(textureID);
SysFont.UpdateQueuedTexture(textureID);
_lastText = _text;
_lastFontName = FontName;
_lastFontSize = _fontSize;
_lastIsBold = _isBold;
_lastIsItalic = _isItalic;
_lastAlignment = _alignment;
_lastIsMultiLine = _isMultiLine;
_lastMaxWidthPixels = _maxWidthPixels;
_lastMaxHeightPixels = _maxHeightPixels;
_lastLineBreakMode = _lineBreakMode;
_lastFillColor = _fillColor;
_lastIsStrokeEnabled = _isStrokeEnabled;
_lastStrokeWidth = _strokeWidth;
_lastStrokeColor = _strokeColor;
_lastIsShadowEnabled = _isShadowEnabled;
_lastShadowOffset = _shadowOffset;
_lastShadowColor = _shadowColor;
}