using Cysharp.Threading.Tasks; using System.Linq; using TMPro; using UnityEngine; using UnityEngine.UI; using UnityEngine.InputSystem.XR; using UVC.UI.Modal; namespace EnglewoodLAB.Modal.View { public class SettingModalView : ModalView { private RectTransform contentRect; public override async UniTask OnOpen(ModalContent content) { SetUI(content); await base.OnOpen(content); gameObject.SetActive(false); } private void SetUI(ModalContent content) { var textmeshpros = GetComponentsInChildren(); var rectItems = GetComponentsInChildren(); if (titleText == null) { titleText = textmeshpros.FirstOrDefault(x => x.name.Equals("Text_Title")); } if (contentRect == null) { contentRect = rectItems.FirstOrDefault(x => x.name.Equals("Content")); if(contentRect !=null) { var sprite = Resources.Load(content.ImagePath); if (sprite == null) Debug.Log($"{content.ImagePath}¿¡ ÆÄÀÏÀÌ ¾øÀ½"); var img = contentRect.GetComponent(); img.sprite = sprite; } } } } }