SysFontTexture.Update C# (CSharp) Метод

Update() публичный Метод

public Update ( ) : void
Результат void
    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;
    }

Usage Example

Пример #1
0
    protected virtual void Update()
    {
        if (_texture.NeedsRedraw)
        {
            if (_texture.Update() == false)
            {
                return;
            }
            UpdateMesh();
            _material.mainTexture = Texture;
        }

        if (_texture.IsUpdated == false)
        {
            return;
        }

        if ((_fontColor != _lastFontColor) && (_material != null))
        {
            _material.color = _fontColor;
            _lastFontColor  = _fontColor;
        }

        if (_lastPivot != _pivot)
        {
            UpdatePivot();
        }
    }
All Usage Examples Of SysFontTexture::Update
SysFontTexture