36 lines
1.0 KiB
C#
36 lines
1.0 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Assignment : UIController
|
|
{
|
|
public List<(string,string)> str;
|
|
[SerializeField] AssignmentSon ass;
|
|
[SerializeField] Transform trans;
|
|
[SerializeField] List<AssignmentSon> assignments = new List<AssignmentSon>();
|
|
[SerializeField] SelectPanel selectPanel;
|
|
|
|
public void Start()
|
|
{
|
|
initTest();
|
|
for (int i = 0; i < str.Count; i++)
|
|
{
|
|
AssignmentSon temp = Instantiate(ass, trans);
|
|
temp.name = str[i].Item1;
|
|
temp.path = str[i].Item2;
|
|
temp.g1 = gameObject;
|
|
temp.selectPanel = selectPanel;
|
|
assignments.Add(temp);
|
|
}
|
|
}
|
|
void initTest()
|
|
{
|
|
str = new List<(string,string)> ();
|
|
(string, string) da = new();
|
|
da.Item1 = "Ê¢ÌÆ·ç²É";
|
|
da.Item2 = "https://img2023.cnblogs.com/blog/1913844/202212/1913844-20221213112544446-1833397619.png";
|
|
str.Add(da);
|
|
}
|
|
}
|