using UnityEngine; using UnityEngine.UI; namespace SK.Framework { public static class ImageExtension { public static T SetSprite(this T self, Sprite sprite) where T : Image { self.sprite = sprite; return self; } public static T SetType(this T self, Image.Type type) where T : Image { self.type = type; return self; } public static T SetUseSpriteMesh(this T self, bool useSpriteMesh) where T : Image { self.useSpriteMesh = useSpriteMesh; return self; } public static T SetPreserveAspect(this T self, bool preserveAspect) where T : Image { self.preserveAspect = preserveAspect; return self; } public static T SetPixelPerUnitMultiplier(this T self, int pixelPerUnitMultiplier) where T : Image { self.pixelsPerUnitMultiplier = pixelPerUnitMultiplier; return self; } public static T SetFillMethod(this T self, Image.FillMethod fillMethod) where T : Image { self.fillMethod = fillMethod; return self; } public static T SetFillOrigin(this T self, int fillOrigin) where T : Image { self.fillOrigin = fillOrigin; return self; } public static T SetFillAmount(this T self, float fillAmount) where T : Image { self.fillAmount = fillAmount; return self; } public static T SetClockwise(this T self, bool clockwise) where T : Image { self.fillClockwise = clockwise; return self; } } }