private IEnumerator loadMascotIcon(SpriteContentKey iconKey, string mascotName) { UILoadingController.RegisterLoad(base.gameObject); AssetRequest <Sprite> assetRequest = Content.LoadAsync(iconKey, mascotName); yield return(assetRequest); if (assetRequest.Asset == null) { Log.LogError(this, "Missing mascot icon at " + iconKey); } MascotIconImage.sprite = assetRequest.Asset; UILoadingController.RegisterLoadComplete(base.gameObject); }
private IEnumerator loadMascotProgressItem(Mascot mascot) { UILoadingController.RegisterLoad(base.gameObject); PrefabContentKey assetKey = new PrefabContentKey(mascotItemContentKey, mascot.Name); if (Content.ContainsKey(assetKey.Key)) { AssetRequest <GameObject> assetRequest = Content.LoadAsync(assetKey); yield return(assetRequest); GameObject mascotItemGO = Object.Instantiate(assetRequest.Asset); mascotItemGO.transform.SetParent(MascotContentParent, worldPositionStays: false); MascotProgressDisplayItem mascotProgressItem = mascotItemGO.GetComponent <MascotProgressDisplayItem>(); mascotProgressItem.LoadMascot(mascot); } UILoadingController.RegisterLoadComplete(base.gameObject); }