Showing
1 changed file
with
8 additions
and
14 deletions
@@ -32,11 +32,7 @@ public class ImageViewerManager : MonoBehaviour | @@ -32,11 +32,7 @@ public class ImageViewerManager : MonoBehaviour | ||
32 | Instance = this; | 32 | Instance = this; |
33 | panel.SetActive(false); | 33 | panel.SetActive(false); |
34 | var panelBtn = panel.GetComponent<Button>(); | 34 | var panelBtn = panel.GetComponent<Button>(); |
35 | - panelBtn.onClick.AddListener(() => | ||
36 | - { | ||
37 | - fullImage.sprite = null; | ||
38 | - panel.SetActive(false); | ||
39 | - }); | 35 | + panelBtn.onClick.AddListener(Hide); |
40 | } | 36 | } |
41 | 37 | ||
42 | public void ShowImage(string url,string content,string logo,string time) | 38 | public void ShowImage(string url,string content,string logo,string time) |
@@ -75,7 +71,7 @@ public class ImageViewerManager : MonoBehaviour | @@ -75,7 +71,7 @@ public class ImageViewerManager : MonoBehaviour | ||
75 | imageContainer.rectTransform.sizeDelta = new Vector2(width, height); | 71 | imageContainer.rectTransform.sizeDelta = new Vector2(width, height); |
76 | 72 | ||
77 | StartCoroutine(ImageLoader.LoadImage(logo, logoImage)); | 73 | StartCoroutine(ImageLoader.LoadImage(logo, logoImage)); |
78 | - | 74 | + })); |
79 | 75 | ||
80 | //时间 | 76 | //时间 |
81 | foreach (Transform child in timeGrid) | 77 | foreach (Transform child in timeGrid) |
@@ -93,18 +89,16 @@ public class ImageViewerManager : MonoBehaviour | @@ -93,18 +89,16 @@ public class ImageViewerManager : MonoBehaviour | ||
93 | 89 | ||
94 | 90 | ||
95 | 91 | ||
96 | - | ||
97 | - | ||
98 | - })); | ||
99 | - | ||
100 | - | ||
101 | - | ||
102 | - | ||
103 | - | ||
104 | } | 92 | } |
105 | 93 | ||
106 | public void Hide() | 94 | public void Hide() |
107 | { | 95 | { |
96 | + fullImage.sprite = null; | ||
108 | panel.SetActive(false); | 97 | panel.SetActive(false); |
98 | + //清空原来的时间 | ||
99 | + foreach (Transform child in timeGrid) | ||
100 | + { | ||
101 | + Destroy(child.gameObject); | ||
102 | + } | ||
109 | } | 103 | } |
110 | } | 104 | } |
-
Please register or login to post a comment