68 lines
1.7 KiB
C#
68 lines
1.7 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class JueseChoicePop : MonoBehaviour
|
|
{
|
|
public ClassMate classMate;
|
|
public ClassItem classItem;
|
|
|
|
public Button CloseBtn;
|
|
public Button Surebtn;
|
|
public GameObject classmatePrefab;
|
|
public Transform content;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
this.gameObject.SetActive(false);
|
|
CloseBtn.onClick.AddListener(CLosePop);
|
|
Surebtn.onClick.AddListener(CLosePop);
|
|
Surebtn.onClick.AddListener(SetFenguan);
|
|
SetClass();
|
|
}
|
|
void CLosePop()
|
|
{
|
|
this.gameObject.SetActive(false);
|
|
}
|
|
public void openPop()
|
|
{
|
|
this.gameObject.SetActive(true);
|
|
}
|
|
void SetFenguan()
|
|
{
|
|
//设置此区分的分管人员为用户选中的角色,并刷新界面信息
|
|
classItem.isSet = true;
|
|
//classItem.setClassItem();
|
|
}
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
public void SetClass()
|
|
{
|
|
for (int i = 0; i < 10; i++)
|
|
{
|
|
|
|
GameObject item = GameObject.Instantiate<GameObject>(classmatePrefab, content);
|
|
ClassMate classMate = item.GetComponent<ClassMate>();
|
|
classMate.SetJc(this);
|
|
}
|
|
}
|
|
|
|
public void SetClassItem(ClassItem classItem)
|
|
{
|
|
this.classItem = classItem;
|
|
}
|
|
|
|
|
|
public void SetClassMate(ClassMate classMate)
|
|
{
|
|
classItem.isSet = true;
|
|
this.classMate = classMate;
|
|
classItem.setClassItem(classMate.classmatename.text);
|
|
classMate.classmatename.text = classMate.classmatename.text + "(" + classItem.classname.text + ")";
|
|
}
|
|
}
|