| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- /* 教程界面(主界面功能) */
- public class CourseView : MonoBehaviour
- {
- [SerializeField] GameObject scrollViewContent;
- [SerializeField] GameObject scrollViewContentItem;
- string[] titles = {
- "弓的介绍及护具佩戴",
- "热身",
- "站姿",
- "沉肩转臂",
- "搭箭推弓",
- "预开弓",
- "举弓开弓",
- "靠位",
- "瞄准",
- "撒放",
- "结束动作"
- };
- public void Awake() {
- scrollViewContentItem.SetActive(false);
- int id = 0;
- foreach (string title in titles)
- {
- id++;
- int currentID = id;
- GameObject item = Instantiate<GameObject>(scrollViewContentItem, scrollViewContent.transform);
- item.GetComponent<Text>().text = currentID + "、" + 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";
- });
- item.SetActive(true);
- }
- }
- public void back() {
- AudioMgr.ins.PlayBtn();
- Destroy(this.gameObject);
- }
- }
|