using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; public class __CaseCenterPanel : UIController { [SerializeField] Button button; [SerializeField] Transform trans; [SerializeField] AssignmentSon ass; public List<(string,string)> data = new List<(string,string)>(); List Btn; [SerializeField] GameObject g1; [SerializeField] SelectPanel SelectPanel; private void Start() { initTest(); Btn = new List(); show(); } // Start is called before the first frame update public override void show() { //g1.SetActive(false); for (int i = 0; i < data.Count; i++) { AssignmentSon tempbutton = Instantiate(ass, trans); tempbutton.name = data[i].Item1; tempbutton.selectPanel = SelectPanel; tempbutton.g1 = g1; Btn.Add(tempbutton); } } void initTest() { (string, string) da = new(); da.Item1 = "案例中心"; da.Item2 = "https://img2023.cnblogs.com/blog/1913844/202212/1913844-20221213112016092-1033925043.png"; data.Add(da); (string, string) da1 = new(); da1.Item1 = "案例中心1"; da1.Item2 = "https://img2023.cnblogs.com/blog/1913844/202212/1913844-20221213112016092-1033925043.png"; data.Add(da1); (string, string) da2 = new(); da2.Item1 = "案例中心2"; da2.Item2 = "https://img2023.cnblogs.com/blog/1913844/202212/1913844-20221213112016092-1033925043.png"; data.Add(da2); (string, string) da3 = new(); da3.Item1 = "案例中心3"; da3.Item2 = "https://img2023.cnblogs.com/blog/1913844/202212/1913844-20221213112016092-1033925043.png"; data.Add(da3); } }