public void UpdateAndResize(Rect rect, Sprite baseSprite, Sprite dummySprite, TextureInfo textureInfo, SpriteConfigData data)
        {
            if (!dummySprite.TryGetVertexAndTriangle2D(data, out _vertices, out _triangles, _meshRenderType))
            {
                _vertices  = baseSprite.vertices;
                _triangles = baseSprite.triangles;
            }

            Vector2[] vertices       = _vertices.ToArray();
            float     spriteMinScale = GetMinRectScale(rect, textureInfo.rect);

            _scaledVertices = MeshUtil.GetScaledVertices(vertices, textureInfo, spriteMinScale, true);
        }
Ejemplo n.º 2
0
 public override void OverrideGeometry(Sprite baseSprite, Sprite dummySprite, TextureInfo textureInfo, SpriteConfigData data)
 {
     dummySprite.GetVertexAndTriangle2D(data, out var vertices, out var triangles, MeshRenderType.Opaque);
     vertices = MeshUtil.GetScaledVertices(vertices, textureInfo, isClamped: true);
     baseSprite.OverrideGeometry(vertices, triangles);
 }