private void AddQuad( VertexHelper vertexHelper, Rect bounds, Vector2 posMin, Vector2 posMax, ColorMode mode, Color colorA, Color colorB, Vector2 uvMin, Vector2 uvMax) { ImageAppearanceProviderHelper.AddQuad(vertexHelper, bounds, posMin, posMax, mode, colorA, colorB, uvMin, uvMax, materialProperties); }
protected override void OnPopulateMesh(VertexHelper vh) { Rect rect = GetPixelAdjustedRect(); Vector2 pMin = new Vector2(rect.x, rect.y); Vector2 pMax = new Vector2(rect.x + rect.width, rect.y + rect.height); float w = (texture != null) ? (float)texture.width * texture.texelSize.x : 1; float h = (texture != null) ? (float)texture.height * texture.texelSize.y : 1; Vector2 uvMin = new Vector2(this.uvRect.xMin * w, this.uvRect.yMin * h); Vector2 uvMax = new Vector2(this.uvRect.xMax * w, this.uvRect.yMax * h); vh.Clear(); ImageAppearanceProviderHelper.AddQuad(vh, rect, pMin, pMax, colorMode, color, secondColor, uvMin, uvMax, materialProperties); }