123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class UserChooseScene : MonoBehaviour
- {
- public GameObject cs;
- public GameObject st;
- public UserChooseSceneItem item;
- List<UserChooseSceneItem> list = new List<UserChooseSceneItem>();
- // Start is called before the first frame update
- void Start()
- {
- initList();
- }
- public void initList()
- {
- Debug.Log("当前场景===》" + UserSceneManager.Instance.SceneList.Count) ;
- foreach(var i in UserSceneManager.Instance.SceneList.Values)
- {
- UserChooseSceneItem go = GameObject.Instantiate(item, item.transform.parent);
- go.gameObject.SetActive(true);
- go.itemName.text = i.name;
- go.id = i.id;
- list.Add(go);
- }
- list[0].tg.isOn = true;
- }
- public void gotoScene()
- {
- GameManager.Instance.isShowDownTip = true;
- UIManager.Instance.ShowUI(UINameConfig.LoadingPanel, typeof(LoadingPanel), (int)ELoadState.download);
- cs.SetActive(false);
-
- for (int i = 0; i < list.Count; i++)
- {
- if(list[i].tg.isOn)
- {
- GameScene.Instance.gotoScenes(list[i].id);
- break;
- }
- }
- DownloadResManager.Instance.StartDownLoad();
- }
- public void CloseCS()
- {
- cs.SetActive(false);
- }
- }
|