|
|
@@ -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);
|
|
|
}
|