using System; using CIG.Extensions; using SUISS.Promo; using SUISSEngine; using UnityEngine; public class OtherGamesPopupState : PopupBaseState { public override void Init() { base.Init(); this.ssGames.GetOtherGamesList(true, new Action(this.PopulateGrid), true); } public override void Enter(State oldState) { base.Enter(oldState); this.InvokeNextFrame(new Action(this.ResetScroll)); } private void PopulateGrid(SparkSocGame[] games) { int num = games.Length; for (int i = 0; i < num; i++) { SparkSocGame sparkSocGame = games[i]; if (!(sparkSocGame.BannerImage == null)) { OtherGameItem otherGameItem = UnityEngine.Object.Instantiate(this._otherGameItemPrefab, this._itemsTransform); otherGameItem.name = i.ToString("D2"); otherGameItem.Init(sparkSocGame); } } this.ResetScroll(); } private void ResetScroll() { ((OtherGamesPopupView)this.View).ResetScroll(); } [SerializeField] private SparkSocGames ssGames; [SerializeField] private OtherGameItem _otherGameItemPrefab; [SerializeField] private Transform _itemsTransform; }