_xiaofang/xiaofang/Assets/yhj/scripts/JueseChoicePop.cs

77 lines
1.9 KiB
C#
Raw Normal View History

2024-11-30 17:43:21 +08:00
using System.Collections;
using System.Collections.Generic;
2024-12-01 22:24:03 +08:00
using Unity.VisualScripting;
2024-11-30 17:43:21 +08:00
using UnityEngine;
using UnityEngine.UI;
public class JueseChoicePop : MonoBehaviour
{
2024-12-01 19:24:07 +08:00
public ClassMate classMate;
public ClassItem classItem;
2024-11-30 17:43:21 +08:00
public Button CloseBtn;
public Button Surebtn;
public GameObject classmatePrefab;
public Transform content;
2024-12-01 22:24:03 +08:00
public List<ClassMate> classMateList = new List<ClassMate> ();
2024-12-10 18:14:08 +08:00
public string s;
//Start is called before the first frame update
2024-11-30 17:43:21 +08:00
void Start()
{
this.gameObject.SetActive(false);
CloseBtn.onClick.AddListener(CLosePop);
Surebtn.onClick.AddListener(CLosePop);
Surebtn.onClick.AddListener(SetFenguan);
2024-12-10 21:34:19 +08:00
//SetClass();
2024-11-30 17:43:21 +08:00
}
void CLosePop()
{
this.gameObject.SetActive(false);
}
public void openPop()
{
this.gameObject.SetActive(true);
}
void SetFenguan()
{
//<2F><><EFBFBD>ô<EFBFBD><C3B4><EFBFBD><EFBFBD>ֵķֹ<C4B7><D6B9><EFBFBD>ԱΪ<D4B1>û<EFBFBD>ѡ<EFBFBD>еĽ<D0B5>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>ˢ<EFBFBD>½<EFBFBD><C2BD><EFBFBD><EFBFBD><EFBFBD>Ϣ
2024-12-01 19:24:07 +08:00
classItem.isSet = true;
//classItem.setClassItem();
2024-11-30 17:43:21 +08:00
}
// Update is called once per frame
void Update()
{
2024-12-10 18:14:08 +08:00
2024-11-30 17:43:21 +08:00
}
2024-12-10 21:34:19 +08:00
public void SetClass(int id)
2024-11-30 17:43:21 +08:00
{
2024-12-10 21:34:19 +08:00
2024-11-30 17:43:21 +08:00
for (int i = 0; i < 10; i++)
{
GameObject item = GameObject.Instantiate<GameObject>(classmatePrefab, content);
2024-12-10 18:14:08 +08:00
2024-11-30 17:43:21 +08:00
ClassMate classMate = item.GetComponent<ClassMate>();
2024-12-01 22:24:03 +08:00
classMateList.Add(classMate);
2024-12-10 18:14:08 +08:00
//classMate.SetJc(this);
2024-11-30 17:43:21 +08:00
}
}
2024-12-01 19:24:07 +08:00
public void SetClassItem(ClassItem classItem)
{
this.classItem = classItem;
}
2024-12-10 18:14:08 +08:00
public void SetClassMate(ClassMate classMate, string a = "")
2024-12-01 19:24:07 +08:00
{
2024-12-01 22:24:03 +08:00
classMate.isBeSet = true;
2024-12-01 19:24:07 +08:00
classItem.isSet = true;
this.classMate = classMate;
2024-12-10 18:14:08 +08:00
//classItem.setClassItem(classMate.classmatename.text);
2024-12-01 22:24:03 +08:00
//s = classMate.classmatename.text;
this.classMate.classmatename.text = classMate.classmatename.text + "(" + classItem.classname.text + ")";
}
2024-11-30 17:43:21 +08:00
}