public void SetContent(LevelBrowser.ListElement data)
 {
     if (data == null)                                      //Exit if told to not display anything
     {
         gameObject.SetActive(false);
         return;
     }
     gameObject.SetActive(true);
     //idLabel.text = data.id.ToString();
     titleLabel.text = data.title;
     authorLabel.text = data.author;
     dateLabel.text = data.date;
     playsLabel.text = data.plays.ToString();
     ratingBar.fillAmount = (float)data.likes / (data.likes + data.dislikes);
 }
 public void Create(LevelBrowser list,int index)
 {
     button = GetComponent<Button>();
     button.onClick.AddListener(new UnityEngine.Events.UnityAction(delegate { list.ShowLevelDetails(index); }));
     SetContent(null);
 }
Пример #3
0
 public void Create(LevelBrowser list, int index)
 {
     button = GetComponent <Button>();
     button.onClick.AddListener(new UnityEngine.Events.UnityAction(delegate { list.ShowLevelDetails(index); }));
     SetContent(null);
 }