Exemplo n.º 1
0
        protected virtual async void HandleItemUpdated(UnlockableItemUpdatedArgs _)
        {
            while (UnlockableId is null) // We get here after first OnEnable, but ID is not set yet.
            {
                await UniTask.DelayFrame(1);

                if (!gameObject)
                {
                    return;
                }
            }

            if (!unlockableManager.ItemUnlocked(UnlockableId))
            {
                thumbnailImage.texture = lockedTexture;
            }
            else
            {
                thumbnailImage.texture = await LoadCGTextureAsync();
            }
        }
Exemplo n.º 2
0
        protected virtual async void HandleItemUpdated(UnlockableItemUpdatedArgs _)
        {
            while (Id is null) // We get here after first OnEnable, but ID is not set yet.
            {
                await UniTask.DelayFrame(1);

                if (!gameObject)
                {
                    return;
                }
            }

            await LoadCGTexturesAsync();

            if (!AnyUnlocked)
            {
                ThumbnailImage.texture = LockedTexture;
            }
            else
            {
                ThumbnailImage.texture = CGTextures.FirstOrDefault(t => t != null);
            }
        }