public void ReleaseResources(object holder, string movieName) { if (!videoLoader.IsLoaded(movieName)) { return; } var resource = videoLoader.GetLoadedOrNull(movieName); resource.Release(holder); }
/// <summary> /// Attempts to retrieve currently assigned avatar texture for a character with the provided ID. /// Will return null when character is not found or doesn't have an avatar texture assigned. /// </summary> public Texture2D GetAvatarTextureFor(string characterId) { var avatarTexturePath = GetAvatarTexturePathFor(characterId); if (avatarTexturePath is null) { return(null); } return(avatarTextureLoader.GetLoadedOrNull(avatarTexturePath)); }
public virtual async UniTask <Texture2D> LoadCGTextureAsync() { Texture2D cgTexture; if (textureLoader.IsLoaded(textureLocalPath)) { cgTexture = textureLoader.GetLoadedOrNull(textureLocalPath); } else { thumbnailImage.texture = loadingTexture; var resource = await textureLoader.LoadAsync(textureLocalPath); resource?.Hold(this); cgTexture = resource; } thumbnailImage.texture = unlockableManager.ItemUnlocked(UnlockableId) ? cgTexture : lockedTexture; return(cgTexture); }
public void Stop() { Player?.Stop(); playCTS?.Cancel(); playCTS?.Dispose(); playCTS = null; videoLoader?.GetLoadedOrNull(playedMovieName)?.Release(this); playedMovieName = null; OnMovieStop?.Invoke(); }
public void ReleaseResources(object holder, string movieName) { #if UNITY_WEBGL && !UNITY_EDITOR return; #else if (!videoLoader.IsLoaded(movieName)) { return; } var resource = videoLoader.GetLoadedOrNull(movieName); resource.Release(holder); #endif }
public virtual async UniTask <Texture2D> LoadCGTextureAsync() { Texture2D cgTexture; if (textureLoader.IsLoaded(textureLocalPath)) { cgTexture = textureLoader.GetLoadedOrNull(textureLocalPath); } else { thumbnailImage.texture = loadingTexture; var resource = await textureLoader.LoadAndHoldAsync(textureLocalPath, this); cgTexture = resource; } return(cgTexture); }
public async Task <Texture2D> LoadCGTextureAsync() { Texture2D cgTexture; if (textureLoader.IsLoaded(textureLocalPath)) { cgTexture = textureLoader.GetLoadedOrNull(textureLocalPath); } else { thumbnailImage.texture = loadingTexture; cgTexture = await textureLoader.LoadAsync(textureLocalPath); } thumbnailImage.texture = unlockableManager.ItemUnlocked(UnlockableId) ? cgTexture : lockedTexture; return(cgTexture); }