1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- 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()
- {
- cs.SetActive(false);
- st.SetActive(true);
- for (int i = 0; i < list.Count; i++)
- {
- if(list[i].tg.isOn)
- {
- GameScene.Instance.gotoScenes(list[i].id);
- break;
- }
- }
- }
- }
|