From f7b9a689e52efc85063ab14b5f3215aa70a7336e Mon Sep 17 00:00:00 2001 From: Auros Nexus <41306347+Auros@users.noreply.github.com> Date: Thu, 27 Jun 2024 06:17:42 -0400 Subject: [PATCH] "why are the images not loading anymore?" --- SmartImage/Assets/SmartImage/Runtime/SmartImageManager.cs | 4 ++++ SmartImage/Assets/SmartImage/package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/SmartImage/Assets/SmartImage/Runtime/SmartImageManager.cs b/SmartImage/Assets/SmartImage/Runtime/SmartImageManager.cs index 2a893c3..6753948 100644 --- a/SmartImage/Assets/SmartImage/Runtime/SmartImageManager.cs +++ b/SmartImage/Assets/SmartImage/Runtime/SmartImageManager.cs @@ -80,7 +80,10 @@ public class SmartImageManager : MonoBehaviour // If the sprite is already in the cache, and it's valid, return it. if (_sprites.TryGetValue(id, out var smartSprite) && smartSprite.State == MediaState.Valid) + { + _semaphore.Release(); return smartSprite; + } // Later we want to check if this caller was the one that created the sprite. bool createdNewSprite = false; @@ -128,6 +131,7 @@ public class SmartImageManager : MonoBehaviour { _sprites.Remove(id); _currentlyBuilding.RemoveAll(c => c.Id == id); + _semaphore.Release(); if (e is TaskCanceledException) return null; diff --git a/SmartImage/Assets/SmartImage/package.json b/SmartImage/Assets/SmartImage/package.json index 98f1a95..41a7a6b 100644 --- a/SmartImage/Assets/SmartImage/package.json +++ b/SmartImage/Assets/SmartImage/package.json @@ -1,7 +1,7 @@ { "name": "dev.auros.smartimage", "displayName": "SmartImage", - "version": "0.0.3-beta", + "version": "0.0.4-beta", "unity": "2021.3", "description": "A smarter way with dealing with images loaded at runtime in Unity.", "keywords": ["Async", "Image", "Sprite", "Texture"],