Beispiel #1
0
        public static void RegisterLoadComplete(GameObject loadingObject)
        {
            UILoadingController componentInParent = loadingObject.GetComponentInParent <UILoadingController>();

            if (componentInParent != null)
            {
                componentInParent.CompleteLoad(loadingObject);
            }
        }
Beispiel #2
0
        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);
        }