Exemplo n.º 1
0
        public CanvasImage AddImage(string name, Texture2D tex, Vector2 pos, Vector2 size, Rect subSprite)
        {
            CanvasImage image = new CanvasImage(canvas, tex, position + pos, size, subSprite);

            images.Add(name, image);

            return(image);
        }
Exemplo n.º 2
0
        public CanvasPanel(GameObject parent, Texture2D tex, Vector2 pos, Vector2 sz, Rect bgSubSection)
        {
            if (parent == null)
            {
                return;
            }

            if (sz.x == 0 || sz.y == 0)
            {
                size = new Vector2(bgSubSection.width, bgSubSection.height);
            }
            else
            {
                size = sz;
            }

            position   = pos;
            canvas     = parent;
            background = new CanvasImage(parent, tex, pos, sz, bgSubSection);
        }