public void Init() { TMPro.TMP_InputField tif = GetComponentInChildren <TMPro.TMP_InputField>(); if (tif != null) { EventBind.IfNotAlready(setText, tif, "set_text"); getText = () => tif.text; } TMPro.TMP_Text tmp = GetComponentInChildren <TMPro.TMP_Text>(); if (tmp != null) { EventBind.IfNotAlready(setText, tmp, "set_text"); getText = () => tmp.text; } InputField inf = GetComponentInChildren <InputField>(); if (inf != null) { EventBind.IfNotAlready(setText, inf, "set_text"); getText = () => inf.text; } Text txt = GetComponentInChildren <Text>(); if (txt != null) { EventBind.IfNotAlready(setText, txt, "set_text"); getText = () => txt.text; } if (UiImage.HasImageHolder(gameObject)) { EventBind.IfNotAlready(setText, this, SetImageByName); getText = GetImageName; } }
public string GetImageName() { return(UiImage.GetImageName(gameObject)); }
public void SetImageByName(string name) { UiImage.SetSpriteByName(gameObject, name); }