暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

Auto_Alarm.cs 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class Auto_Alarm : MonoBehaviour
  7. {
  8. [SerializeField] GameObject 異常燈號_pic;
  9. public int[] 電能異常BL_code;
  10. /*void Update()
  11. {
  12. if(Main.Global.系統選擇=="消防系統"){
  13. if(Main.Global.消防異常清單.Rows.Count > 0 ){
  14. bool hasException = false; // 設定一個 flag,紀錄是否有設定過有異常為 true
  15. foreach (DataRow row in Main.Global.消防異常清單.Rows) {
  16. if (row[3].ToString() == 異常燈號_pic.name) {
  17. if (!GetComponent<Animator>().GetBool("有異常")) {
  18. GetComponent<Animator>().SetBool("有異常", true);
  19. }
  20. hasException = true; // 將 flag 設為 true,表示已設定過有異常為 true
  21. }
  22. }
  23. if (!hasException) { // 如果沒有符合條件的資料
  24. GetComponent<Animator>().SetBool("有異常", false); // 將有異常設為 false
  25. }
  26. }else{
  27. GetComponent<Animator>().SetBool("有異常", false);
  28. }
  29. }else if(Main.Global.系統選擇=="電能監控系統"){
  30. foreach (int code in 電能異常BL_code){
  31. if(Main.Global.電表異常BL[code]==true){
  32. if (!GetComponent<Animator>().GetBool("有異常")) {
  33. GetComponent<Animator>().SetBool("有異常", true);
  34. }
  35. }else{
  36. GetComponent<Animator>().SetBool("有異常", false);
  37. }
  38. }
  39. }
  40. }*/
  41. }