Ejemplo n.º 1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        protected override void UpdateMesh()
        {
            HoverShapeRect shape     = GetComponent <HoverShapeRect>();
            float          innerProg = GetDimensionProgress(InnerSizeType);
            float          outerProg = GetDimensionProgress(OuterSizeType);
            float          outerW;
            float          outerH;
            float          innerW;
            float          innerH;

            if (shape.SizeX >= shape.SizeY)
            {
                outerH = shape.SizeY * outerProg;
                innerH = shape.SizeY * innerProg;
                outerW = shape.SizeX - (shape.SizeY - outerH);
                innerW = shape.SizeX - (shape.SizeY - innerH);
            }
            else
            {
                outerW = shape.SizeX * outerProg;
                innerW = shape.SizeX * innerProg;
                outerH = shape.SizeY - (shape.SizeX - outerW);
                innerH = shape.SizeY - (shape.SizeX - innerW);
            }

            MeshUtil.BuildHollowRectangleMesh(vMeshBuild, outerW, outerH, innerW, innerH);

            UpdateAutoUv(shape, outerW, outerH);
            UpdateMeshUvAndColors();
            vMeshBuild.Commit();
            vMeshBuild.CommitColors();
        }