您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

70 行
1.4 KiB

  1. using System;
  2. using SUISSEngine;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. namespace SUISS.Promo
  6. {
  7. public class LoadingScreenController : MonoBehaviour
  8. {
  9. protected void Start()
  10. {
  11. this.Hide();
  12. }
  13. public void Initialise(string sparksocGameId)
  14. {
  15. this.moreGames.GetMoreGamesList(true, delegate(SparkSocGame[] items)
  16. {
  17. this.Show(items);
  18. }, true);
  19. }
  20. protected virtual void Show(SparkSocGame[] items)
  21. {
  22. if (items.Length > 0)
  23. {
  24. this.root.SetActive(true);
  25. foreach (SparkSocGame item in items)
  26. {
  27. this.CreateMoreGameItem(item);
  28. }
  29. this.scrollView.verticalNormalizedPosition = 1f;
  30. }
  31. else
  32. {
  33. this.Hide();
  34. }
  35. }
  36. protected void Hide()
  37. {
  38. this.root.SetActive(false);
  39. }
  40. protected virtual void CreateMoreGameItem(SparkSocGame item)
  41. {
  42. GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(this.otherGamePrefab);
  43. gameObject.transform.SetParent(this.grid.transform);
  44. gameObject.transform.localScale = Vector3.one;
  45. gameObject.name = item.DisplayName;
  46. gameObject.GetComponent<MoreGamesIcon>().Init(item);
  47. }
  48. [SerializeField]
  49. protected GameObject root;
  50. [SerializeField]
  51. private GridLayoutGroup grid;
  52. [SerializeField]
  53. private ScrollRect scrollView;
  54. [SerializeField]
  55. protected GameObject otherGamePrefab;
  56. [SerializeField]
  57. protected SparkSocGames moreGames;
  58. }
  59. }