123456789101112131415161718192021222324252627282930313233 |
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.EventSystems;
- using UnityEngine.UI;
- public class CustomHorizintalScrollView : MonoBehaviour
- {
- public RectTransform content;
- public GameObject itemgo;
- public List<GameObject> itemgolist;
- public int startIndex = 0;
- public int endIndex = 0;
- public void Init(List<SceneValue> m_SceneData, SceneChoose SceneChoose)
- {
- Debug.Log("UpdateSceneItem411");
- if(itemgolist!=null)
- {
- for (int i = 0; i < itemgolist.Count; i++)
- {
- Destroy(itemgolist[i]);
- }
- }
- for (int i = 0; i < m_SceneData.Count; i++)
- {
- itemgolist.Add(Instantiate(itemgo, content));
- itemgolist[itemgolist.Count - 1].SetActive(true) ;
- itemgolist[itemgolist.Count - 1].GetComponent<SChooseItem>().init( m_SceneData[i]);
- }
- }
- }
|