FairyGUI.FillUtils.FillHorizontal C# (CSharp) Метод

FillHorizontal() публичный статический Метод

public static FillHorizontal ( OriginHorizontal origin, float amount, Rect vertRect, Rect uvRect, Vector3 verts, Vector2 uv ) : void
origin OriginHorizontal
amount float
vertRect UnityEngine.Rect
uvRect UnityEngine.Rect
verts UnityEngine.Vector3
uv UnityEngine.Vector2
Результат void
        public static void FillHorizontal(OriginHorizontal origin, float amount, Rect vertRect, Rect uvRect, Vector3[] verts, Vector2[] uv)
        {
            if (origin == OriginHorizontal.Left)
            {
                vertRect.width = vertRect.width * amount;
                uvRect.width = uvRect.width * amount;
            }
            else
            {
                vertRect.x += vertRect.width * (1 - amount);
                vertRect.width = vertRect.width * amount;
                uvRect.x += uvRect.width * (1 - amount);
                uvRect.width = uvRect.width * amount;
            }

            NGraphics.FillVertsOfQuad(verts, 0, vertRect);
            NGraphics.FillUVOfQuad(uv, 0, uvRect);
        }

Usage Example

Пример #1
0
        public void Fill(FillMethod method, float amount, int origin, bool clockwise, Rect vertRect, Rect uvRect)
        {
            amount = Mathf.Clamp01(amount);
            switch (method)
            {
            case FillMethod.Horizontal:
                Alloc(4);
                FillUtils.FillHorizontal((OriginHorizontal)origin, amount, vertRect, uvRect, vertices, uv);
                break;

            case FillMethod.Vertical:
                Alloc(4);
                FillUtils.FillVertical((OriginVertical)origin, amount, vertRect, uvRect, vertices, uv);
                break;

            case FillMethod.Radial90:
                Alloc(4);
                FillUtils.FillRadial90((Origin90)origin, amount, clockwise, vertRect, uvRect, vertices, uv);
                break;

            case FillMethod.Radial180:
                Alloc(8);
                FillUtils.FillRadial180((Origin180)origin, amount, clockwise, vertRect, uvRect, vertices, uv);
                break;

            case FillMethod.Radial360:
                Alloc(12);
                FillUtils.FillRadial360((Origin360)origin, amount, clockwise, vertRect, uvRect, vertices, uv);
                break;
            }
        }
All Usage Examples Of FairyGUI.FillUtils::FillHorizontal