private void OnEnable() { if (collectible == null) { return; } var url = collectible.ComposeThumbnailUrl(); if (string.IsNullOrEmpty(url)) { return; } GetThumbnail(collectible.ComposeThumbnailUrl()); }
private void GetThumbnail() { string url = collectible.ComposeThumbnailUrl(); //NOTE(Brian): Get before forget to prevent referenceCount == 0 and asset unload var newThumbnailPromise = ThumbnailsManager.GetThumbnail(url, OnThumbnailReady); ForgetThumbnail(); thumbnailPromise = newThumbnailPromise; }
public void Initialize(WearableItem collectible) { if (collectible != null) { ForgetThumbnail(collectible.ComposeThumbnailUrl()); } this.collectible = collectible; if (this.collectible == null) { return; } if (gameObject.activeInHierarchy) { GetThumbnail(this.collectible.ComposeThumbnailUrl()); } }