FairyGUI.Container.SetChildrenLayer C# (CSharp) Method

SetChildrenLayer() public method

s
public SetChildrenLayer ( int value ) : void
value int
return void
        public void SetChildrenLayer(int value)
        {
            int cnt = _children.Count;
            for (int i = 0; i < cnt; i++)
            {
                DisplayObject child = _children[i];
                child.layer = value;
                if ((child is Container) && !child.paintingMode)
                    ((Container)child).SetChildrenLayer(value);
            }
        }

Usage Example

Example #1
0
        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);
        }
All Usage Examples Of FairyGUI.Container::SetChildrenLayer