public override void Update(UpdateContext context)
{
if (_disabled)
return;
base.Update(context);
if (_mask != null)
context.EnterClipping(this.id, null, null);
else if (_clipRect != null)
context.EnterClipping(this.id, this.TransformRect((Rect)_clipRect, null), clipSoftness);
float savedAlpha = context.alpha;
context.alpha *= this.alpha;
bool savedGrayed = context.grayed;
context.grayed = context.grayed || this.grayed;
if (_fBatching)
context.batchingDepth++;
if (context.batchingDepth > 0)
{
if (_mask != null)
_mask.graphics.maskFrameId = UpdateContext.frameId;
int cnt = _children.Count;
for (int i = 0; i < cnt; i++)
{
DisplayObject child = _children[i];
if (child.visible)
child.Update(context);
}
}
else
{
if (_mask != null)
{
_mask.graphics.maskFrameId = UpdateContext.frameId;
_mask.renderingOrder = context.renderingOrder++;
}
int cnt = _children.Count;
for (int i = 0; i < cnt; i++)
{
DisplayObject child = _children[i];
if (child.visible)
{
if (child != _mask)
child.renderingOrder = context.renderingOrder++;
child.Update(context);
}
}
if (_mask != null)
_mask.graphics.SetStencilEraserOrder(context.renderingOrder++);
}
if (_fBatching)
{
if (context.batchingDepth == 1)
SetRenderingOrder(context);
context.batchingDepth--;
}
context.alpha = savedAlpha;
context.grayed = savedGrayed;
if (_clipRect != null || _mask != null)
context.LeaveClipping();
if (_paintingMode > 0 && paintingGraphics.texture != null)
UpdateContext.OnEnd += _captureDelegate;
if (onUpdate != null)
onUpdate();
}