Exemple #1
0
        private void OnGenerateVisualContent(MeshGenerationContext mgc)
        {
            if (image == null && vectorImage == null)
            {
                return;
            }

            var rectParams = new MeshGenerationContextUtils.RectangleParams();

            if (image != null)
            {
                rectParams = MeshGenerationContextUtils.RectangleParams.MakeTextured(contentRect, uv, image, scaleMode, panel.contextType);
            }
            else if (vectorImage != null)
            {
                rectParams = MeshGenerationContextUtils.RectangleParams.MakeVectorTextured(contentRect, uv, vectorImage, scaleMode, panel.contextType);
            }
            rectParams.color = tintColor;
            mgc.Rectangle(rectParams);
        }
        private void OnGenerateVisualContent(MeshGenerationContext mgc)
        {
            bool flag = this.image == null && this.vectorImage == null;

            if (!flag)
            {
                MeshGenerationContextUtils.RectangleParams rectParams = default(MeshGenerationContextUtils.RectangleParams);
                bool flag2 = this.image != null;
                if (flag2)
                {
                    rectParams = MeshGenerationContextUtils.RectangleParams.MakeTextured(base.contentRect, this.uv, this.image, this.scaleMode, base.panel.contextType);
                }
                else
                {
                    bool flag3 = this.vectorImage != null;
                    if (flag3)
                    {
                        rectParams = MeshGenerationContextUtils.RectangleParams.MakeVectorTextured(base.contentRect, this.uv, this.vectorImage, this.scaleMode, base.panel.contextType);
                    }
                }
                rectParams.color = this.tintColor;
                mgc.Rectangle(rectParams);
            }
        }
Exemple #3
0
 public static void Rectangle(this MeshGenerationContext mgc, MeshGenerationContextUtils.RectangleParams rectParams)
 {
     mgc.painter.DrawRectangle(rectParams);
 }