public void Begin()
{
current = this;
frameId++;
if (frameId == 0)
frameId = 1;
renderingOrder = 0;
batchingDepth = 0;
rectMaskDepth = 0;
stencilReferenceValue = 0;
alpha = 1;
grayed = false;
clipped = false;
_clipStack.Clear();
Stats.ObjectCount = 0;
Stats.GraphicsCount = 0;
_tmpBegin = OnBegin;
OnBegin = null;
//允许OnBegin里再次Add,这里没有做死锁检查
while (_tmpBegin != null)
{
_tmpBegin.Invoke();
_tmpBegin = OnBegin;
OnBegin = null;
}
working = true;
}