public static void Capture(Container container, RenderTexture texture)
{
CheckMain();
Camera camera = _main.cachedCamera;
camera.targetTexture = texture;
camera.orthographicSize = texture.height / 2 * StageCamera.UnitsPerPixel;
Vector3 v = container.cachedTransform.position;
v.x += camera.orthographicSize * camera.aspect;
v.y -= camera.orthographicSize;
_main.cachedTransform.localPosition = v;
int oldLayer = container.layer;
container.layer = _layer;
container.SetChildrenLayer(_layer);
RenderTexture old = RenderTexture.active;
RenderTexture.active = texture;
GL.Clear(true, true, Color.clear);
camera.Render();
RenderTexture.active = old;
container.layer = oldLayer;
container.SetChildrenLayer(oldLayer);
}