FairyGUI.SelectionShape.Update C# (CSharp) Method

Update() public method

public Update ( UpdateContext context ) : void
context UpdateContext
return void
        public override void Update(UpdateContext context)
        {
            if (_requireUpdateMesh)
            {
                _requireUpdateMesh = false;
                if (_rects != null && _rects.Count > 0)
                {
                    int count = _rects.Count * 4;
                    graphics.Alloc(count);
                    Rect uvRect = new Rect(0, 0, 1, 1);
                    for (int i = 0; i < count; i += 4)
                    {
                        graphics.FillVerts(i, _rects[i / 4]);
                        graphics.FillUV(i, uvRect);
                    }
                    graphics.FillColors(_color);
                    graphics.FillTriangles();
                    graphics.UpdateMesh();
                }
                else
                    graphics.ClearMesh();
            }

            base.Update(context);
        }