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(); } }
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); } }