From 47f51a84f53513a00dfc6cd7a95404cd6e36f69e Mon Sep 17 00:00:00 2001 From: art Date: Sat, 8 Feb 2025 09:25:59 +0900 Subject: [PATCH] =?UTF-8?q?fix=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=8B=A4?= =?UTF-8?q?=EC=9A=B4=EB=A1=9C=EB=93=9C=20=EC=A0=84=EC=97=90=20=EB=AA=A8?= =?UTF-8?q?=EB=8B=AC=20=ED=99=9C=EC=84=B1=ED=99=94=EC=8B=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=EB=B0=98=EC=98=81=EC=95=88=EB=90=98?= =?UTF-8?q?=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/1_Script/ModalCtrl.cs | 24 +++++++++++++++++++++++- Assets/1_Script/SearchCtrl.cs | 3 +-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Assets/1_Script/ModalCtrl.cs b/Assets/1_Script/ModalCtrl.cs index e7e7b50..7a59b95 100644 --- a/Assets/1_Script/ModalCtrl.cs +++ b/Assets/1_Script/ModalCtrl.cs @@ -1,4 +1,6 @@ +using System.Collections; using TMPro; +using Unity.VisualScripting; using UnityEngine; using UnityEngine.UI; @@ -14,10 +16,12 @@ public class ModalCtrl : MonoBehaviour [SerializeField] TMP_Text suitStyle; [SerializeField] GameObject[] colors; + + public void Set(Library library) { gameObject.SetActive(true); - suitImage.texture = library._suit_image; + StartCoroutine(checkImageUpdate(library)); suitImage.SetNativeSize(); RectTransform rect = suitImage.gameObject.GetComponent(); rect.anchorMin = new Vector2(0.5f, 0.5f); @@ -31,5 +35,23 @@ public class ModalCtrl : MonoBehaviour debutDate.text = library.production_date; suitType.text = library.suit_type; suitStyle.text = library.suit_style; + + + + } + + void OnDisable() + { + StopAllCoroutines(); + } + + IEnumerator checkImageUpdate(Library library) + { + while(library._suit_image == null) + { + yield return null; + } + + suitImage.texture = library._suit_image; } } diff --git a/Assets/1_Script/SearchCtrl.cs b/Assets/1_Script/SearchCtrl.cs index 55672f2..07d9aa0 100644 --- a/Assets/1_Script/SearchCtrl.cs +++ b/Assets/1_Script/SearchCtrl.cs @@ -276,8 +276,7 @@ public class SearchCtrl : SingletonMonoBehaviour await request.Send(); - await tcs.Task; - + await tcs.Task; return library._suit_image; }