using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class Drill : MonoBehaviour { public Text username; public Text companyName; private Button ScheduledBtn; private bool isadministrator=false; // 是否为管理员 private bool eventAdded = false; // 防止重复添加事件 public delegate void BoolChangedHandler(bool value); public event BoolChangedHandler OnBoolAChanged; private Text noRoomText; // "没有演练房间"的文本 private Transform content; // Scroll View Content // 记录上一次的 isadministrator 状态,用于减少重复执行逻辑 private bool lastIsAdministratorState; void Start() { ScheduledBtn = transform.Find("down/ScheduledBtn").GetComponent