public static TUIImage Create(Texture2D texture, LayoutElementData element = null) { TUIImage image = createBaseWidget <TUIImage>(element); RawImage uiImage = image.gameObject.AddComponent <RawImage>(); uiImage.texture = texture; image.Graphic = uiImage; return(image); }
public static TUIImage Create(Color color, LayoutElementData element = null) { TUIImage image = createBaseWidget <TUIImage>(element); Image uiImage = image.gameObject.AddComponent <Image>(); uiImage.color = color; image.Graphic = uiImage; return(image); }
public static TUIImage Create(Sprite sprite, LayoutElementData element = null) { TUIImage image = createBaseWidget <TUIImage>(element); Image uiImage = image.gameObject.AddComponent <Image>(); uiImage.sprite = sprite; if (uiImage.sprite.HasBorder()) { uiImage.type = Image.Type.Tiled; } image.Graphic = uiImage; return(image); }