public void Init(UsersManager.UserData data, System.Action <UserButton> _OnClicked) { OnClicked = _OnClicked; this.data = data; field.text = data.username; LoopUntilReady(); }
void AddButton(int id, UsersManager.UserData data) { UserButton b = Instantiate(button); b.transform.SetParent(container); b.Init(data, OnClicked); b.transform.localScale = Vector3.one; }
void LoadImage(Image image, UsersManager.UserData data) { if (data.texture != null) { Sprite newSprite = Sprite.Create(data.texture, new Rect(0, 0, data.texture.width, data.texture.height), Vector2.zero); if (newSprite != null) { image.sprite = newSprite; } } else { Invoke("LoadData", 1); } }