12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class TaskListPanel : MonoBehaviour
- {
- public Button taskTpye_allButton;
- public Button taskTpye_dianQiButton;
- public Button taskTpye_zhaZhanButton;
- public Button taskTpye_diFangButton;
- public Button taskTpye_jianZhuButton;
- public Button taskTpye_zhuanXiangButton;
- public GameObject taskItemPrefab;
-
- public Transform itemContent;
-
- public List<B08_TaskListItem> taskItemList = new List<B08_TaskListItem>();
- public GCYWLayer gcywLayer;
- private void Awake()
- {
-
- }
- public void SetData(GCYWLayer baseLayer)
- {
- gcywLayer = baseLayer;
- for (int i = 0; i < taskItemList.Count; i++)
- {
- Destroy(taskItemList[i].gameObject);
- }
- taskItemList.Clear();
- for (int i = 0; i < GlobalData.B08TaskListInfos.Length; i++)
- {
- var taskInfoList = GlobalData.B08TaskListInfos[i].data.list;
- if (taskInfoList != null)
- {
- for (int j = 0; j < taskInfoList.Length; j++)
- {
- B08_TaskListItem tempItem = Instantiate(taskItemPrefab, itemContent).GetComponent<B08_TaskListItem>();
- tempItem.Init();
- tempItem.SetData(gcywLayer,taskInfoList[j],i);
- taskItemList.Add(tempItem);
- }
- }
- }
- }
- }
|