lvjincheng 3 lat temu
rodzic
commit
4d7eaba50a
1 zmienionych plików z 4 dodań i 3 usunięć
  1. 4 3
      Assets/BowArrow/Scripts/View/CourseView.cs

+ 4 - 3
Assets/BowArrow/Scripts/View/CourseView.cs

@@ -26,14 +26,15 @@ public class CourseView : MonoBehaviour
         scrollViewContentItem.SetActive(false);
         for (int i = 1; i <= videoUrls.Length; i++)
         {
-            string title = TextAutoLanguage2.GetTextByKey("course_title_" + i);
+            int id = i;
+            string title = TextAutoLanguage2.GetTextByKey("course_title_" + id);
             GameObject item = Instantiate<GameObject>(scrollViewContentItem, scrollViewContent.transform);
-            item.GetComponent<Text>().text = i + "、" + title;
+            item.GetComponent<Text>().text = id + "、" + title;
             item.GetComponentInChildren<Button>().onClick.AddListener(delegate() {
                 // GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/VideoView"));
                 // VideoView videoView = o.GetComponent<VideoView>();
                 // videoView.url = $"https://smartbow-course-1258277015.cos.ap-guangzhou.myqcloud.com/{currentID}.mp4";
-                Application.OpenURL(videoUrls[i - 1]);
+                Application.OpenURL(videoUrls[id - 1]);
             });
             item.SetActive(true);
         }