王琪诚

【任务】TAPD#

功能详情
配置文件 否
提交作者 QiCheng.Wang
评审人员
... ... @@ -32,11 +32,7 @@ public class ImageViewerManager : MonoBehaviour
Instance = this;
panel.SetActive(false);
var panelBtn = panel.GetComponent<Button>();
panelBtn.onClick.AddListener(() =>
{
fullImage.sprite = null;
panel.SetActive(false);
});
panelBtn.onClick.AddListener(Hide);
}
public void ShowImage(string url,string content,string logo,string time)
... ... @@ -61,9 +57,9 @@ public class ImageViewerManager : MonoBehaviour
//清空
fullImage.sprite = null;
panel.SetActive(true);
StartCoroutine(ImageLoader.LoadImage(url, fullImage, (width, height) => {
... ... @@ -75,29 +71,21 @@ public class ImageViewerManager : MonoBehaviour
imageContainer.rectTransform.sizeDelta = new Vector2(width, height);
StartCoroutine(ImageLoader.LoadImage(logo, logoImage));
//时间
foreach (Transform child in timeGrid)
{
Destroy(child.gameObject);
}
time = time.Replace("年", "p").Replace("月", "p").Replace("日", "");
foreach (char c in time)
{
GameObject timeObj = Instantiate(timePrefab, timeGrid);
var timeTextMeshPro = timeObj.GetComponent<TextMeshProUGUI>();
timeTextMeshPro.text = "<sprite name=\""+c+"\">";
}
}));
//时间
foreach (Transform child in timeGrid)
{
Destroy(child.gameObject);
}
time = time.Replace("年", "p").Replace("月", "p").Replace("日", "");
foreach (char c in time)
{
GameObject timeObj = Instantiate(timePrefab, timeGrid);
var timeTextMeshPro = timeObj.GetComponent<TextMeshProUGUI>();
timeTextMeshPro.text = "<sprite name=\""+c+"\">";
}
... ... @@ -105,6 +93,12 @@ public class ImageViewerManager : MonoBehaviour
public void Hide()
{
fullImage.sprite = null;
panel.SetActive(false);
//清空原来的时间
foreach (Transform child in timeGrid)
{
Destroy(child.gameObject);
}
}
}
\ No newline at end of file
... ...