public override IEnumerator Initialize() { var imageSheetHandles = new List <AsyncProcessHandle>(); for (var i = 0; i < ImageCount; i++) { var index = i; var handle = _imageContainer.Register(ResourceKey.CharacterModalImageSheetPrefab(), x => { _imageSheets[index] = (x.sheetId, (CharacterModalImageSheet)x.instance); });
public override IEnumerator Initialize() { var registerHandles = new AsyncProcessHandle[ItemGridSheetCount]; for (var i = 0; i < ItemGridSheetCount; i++) { var index = i; registerHandles[i] = _itemGridContainer.Register(ResourceKey.ShopItemGridSheetPrefab(), x => { var id = x.sheetId; _itemGridSheetIds[index] = id; var shopItemGrid = (ShopItemGridSheet)x.instance; shopItemGrid.Setup(index, GetCharacterId(index)); }); } for (var i = 0; i < ItemGridSheetCount; i++) { var handle = registerHandles[i]; while (!handle.IsTerminated) { yield return(null); } var sheetId = _itemGridSheetIds[i]; _itemGridButtons[i].onClick.AddListener(() => { if (_itemGridContainer.IsInTransition) { return; } if (_itemGridContainer.ActiveSheetId == sheetId) { // This sheet is already displayed. return; } _itemGridContainer.Show(sheetId, true); }); } _itemGridContainer.Show(_itemGridSheetIds[0], false); }