| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class BoxNewUser : MonoBehaviour
- {
- [SerializeField] GameObject scrollViewContent;
- [SerializeField] GameObject scrollViewContentItem;
- List<int> titleIds = new List<int>();
- Dictionary<int, string> videoUrlDict = new Dictionary<int, string>();
- void Start()
- {
- titleIds.Add(0);
- if (CommonConfig.AppLanguage == 0)
- {
- //titleIds.Add(12);
- //videoUrlDict.Add(12, "https://www.bilibili.com/video/BV1o84y1K7C9/?vd_source=b030b3eb3477713cd294deb164dcb109");
- //titleIds.Add(13);
- //videoUrlDict.Add(13, "https://www.bilibili.com/video/BV1hj411c7Mx/?vd_source=b030b3eb3477713cd294deb164dcb109");
- titleIds.Add(15);
- videoUrlDict.Add(15, "https://www.bilibili.com/video/BV1Eu4y1L7gh/?vd_source=ab2d11694c7b3b358b665454a7089856");
- titleIds.Add(16);
- videoUrlDict.Add(16, "https://www.bilibili.com/video/BV1Ku4y1c74Y/?vd_source=ab2d11694c7b3b358b665454a7089856");
- titleIds.Add(17);
- videoUrlDict.Add(17, "https://www.bilibili.com/video/BV1B64y1L7n1/?vd_source=ab2d11694c7b3b358b665454a7089856");
- titleIds.Add(18);
- videoUrlDict.Add(18, "https://www.bilibili.com/video/BV1eC4y1y75u/?vd_source=ab2d11694c7b3b358b665454a7089856");
- titleIds.Add(19);
- videoUrlDict.Add(19, "https://www.bilibili.com/video/BV1qc411Q7Xy/?vd_source=ab2d11694c7b3b358b665454a7089856");
- }
- else
- {
- titleIds.Add(14);
- videoUrlDict.Add(14, "https://youtu.be/5AfYbdeFv54");
- }
- scrollViewContentItem.SetActive(false);
- int titleSeq = 1;
- for (int i = 1; i < titleIds.Count; i++)
- {
- var titleId = titleIds[i];
- string title = TextAutoLanguage2.GetTextByKey("course_title_" + titleId);
- GameObject item = Instantiate(scrollViewContentItem, scrollViewContent.transform);
- item.GetComponentInChildren<Text>().text = titleSeq + "、" + title;
- titleSeq++;
- Button btn = item.transform.Find("Btn").GetComponent<Button>();
- btn.onClick.AddListener(delegate () {
- AudioMgr.ins.PlayBtn();
- if (titleId == 0)
- {
- NewUserGuiderManager.ins.ReviewNewUserGuide();
- return;
- }
- else
- {
- Application.OpenURL(videoUrlDict[titleId]);
- return;
- }
- });
- item.SetActive(true);
- }
- }
- }
|