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

56 lines
999 B
C#
Raw Normal View History

2024-12-01 19:24:07 +08:00
using System;
2024-11-30 17:43:21 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class ClassMate : MonoBehaviour
{
2024-12-01 19:24:07 +08:00
public JueseChoicePop jueseChoicePop;
2024-11-30 17:43:21 +08:00
public Text classmatename;
2024-12-01 22:24:03 +08:00
public string s;
2024-12-01 19:24:07 +08:00
public Button otherButton;
public Button button;
2024-12-01 22:24:03 +08:00
public bool isClear = false;
public bool isBeSet = false;
2024-11-30 17:43:21 +08:00
// Start is called before the first frame update
void Start()
{
2024-12-01 19:24:07 +08:00
button.onClick.AddListener(Click);
2024-12-01 22:24:03 +08:00
s = classmatename.text;
2024-12-01 19:24:07 +08:00
}
public void Click()
{
2024-12-01 22:24:03 +08:00
if(isBeSet == false)
{
jueseChoicePop.SetClassMate(this);
}
else
{
jueseChoicePop.ChangeClassMate();
}
2024-12-01 19:24:07 +08:00
}
public void SetJc(JueseChoicePop jc)
{
jueseChoicePop = jc;
2024-11-30 17:43:21 +08:00
}
2024-12-01 22:24:03 +08:00
public void setName()
{
classmatename.text = s;
}
2024-11-30 17:43:21 +08:00
// Update is called once per frame
void Update()
{
}
}