Пример #1
0
        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;
            }
        }
Пример #2
0
 public string GetImageName()
 {
     return(UiImage.GetImageName(gameObject));
 }
Пример #3
0
 public void SetImageByName(string name)
 {
     UiImage.SetSpriteByName(gameObject, name);
 }