Esempio n. 1
0
        public void ReleaseResources(object holder, string movieName)
        {
            if (!videoLoader.IsLoaded(movieName))
            {
                return;
            }
            var resource = videoLoader.GetLoadedOrNull(movieName);

            resource.Release(holder);
        }
Esempio n. 2
0
        /// <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);
        }
Esempio n. 4
0
        public void Stop()
        {
            Player?.Stop();
            playCTS?.Cancel();
            playCTS?.Dispose();
            playCTS = null;

            videoLoader?.GetLoadedOrNull(playedMovieName)?.Release(this);
            playedMovieName = null;

            OnMovieStop?.Invoke();
        }
Esempio n. 5
0
 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
 }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
        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);
        }