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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.SceneManagement;
  5. using UnityEngine.UI;
  6. using UnityEngine.Networking;
  7. using System.Text.RegularExpressions;
  8. using System.Data.SqlClient;
  9. using TMPro;
  10. using System;
  11. using System.IO;
  12. using ZXing;
  13. using ZXing.QrCode;
  14. using System.Net;
  15. using SimpleJSON;
  16. using System.ComponentModel;
  17. public class Main : MonoBehaviour
  18. {
  19. // Start is called before the first frame update
  20. void Start()
  21. {
  22. }
  23. public static class Global
  24. {
  25. public static string 使用者UID, 使用者暱稱, 使用者ID, 使用者GT, 使用者GA,伺服器;
  26. public static bool 螢幕方向,鏡頭啟動 , 回貼;
  27. public static int camfps;
  28. public static float rate , rate_ ,登入條件;
  29. //public static TimeSpan 運行天數;
  30. public static string PA, PB, PC, PD, PE, PF, PG, PH, PI, PJ, PK, PA1, PA2, PA3, PA4, PA5, PA6, PA7, PA8, PA9, PA10;
  31. //public static bool[] 電表異常BL = new bool[999];
  32. // public static Sprite[] Wnum;
  33. // public static Sprite[] Bnum;
  34. public static string[] 系統語言資料;
  35. // public static string[] CC判斷=new string[999];
  36. public static Dictionary<string, string> 系統語言字典 = new Dictionary<string, string>() { };
  37. public static string[,] PHP = new string[5,2];
  38. private static readonly Dictionary<string, int> AgeMap = new Dictionary<string, int>()
  39. {
  40. {"甲子", 1}, {"乙丑", 2}, {"丙寅", 3}, {"丁卯", 4}, {"戊辰", 5}, {"己巳", 6},
  41. {"庚午", 7}, {"辛未", 8}, {"壬申", 9}, {"癸酉", 10}, {"甲戌", 11}, {"乙亥", 12},
  42. {"丙子", 13}, {"丁丑", 14}, {"戊寅", 15}, {"己卯", 16}, {"庚辰", 17}, {"辛巳", 18},
  43. {"壬午", 19}, {"癸未", 20}, {"甲申", 21}, {"乙酉", 22}, {"丙戌", 23}, {"丁亥", 24},
  44. {"戊子", 25}, {"己丑", 26}, {"庚寅", 27}, {"辛卯", 28}, {"壬辰", 29}, {"癸巳", 30},
  45. {"甲午", 31}, {"乙未", 32}, {"丙申", 33}, {"丁酉", 34}, {"戊戌", 35}, {"己亥", 36},
  46. {"庚子", 37}, {"辛丑", 38}, {"壬寅", 39}, {"癸卯", 40}, {"甲辰", 41}, {"乙巳", 42},
  47. {"丙午", 43}, {"丁未", 44}, {"戊申", 45}, {"己酉", 46}, {"庚戌", 47}, {"辛亥", 48},
  48. {"壬子", 49}, {"癸丑", 50}, {"甲寅", 51}, {"乙卯", 52}, {"丙辰", 53}, {"丁巳", 54},
  49. {"戊午", 55}, {"己未", 56}, {"庚申", 57}, {"辛酉", 58}, {"壬戌", 59}, {"癸亥", 60}
  50. };
  51. // 計算虛歲
  52. public static string CalculateAge(string currentYear, string inputYear)
  53. {
  54. int currentAge = AgeMap[currentYear];
  55. int inputAge = AgeMap[inputYear];
  56. int age = currentAge - inputAge + 1;
  57. if (age < 1)
  58. {
  59. age += 60;
  60. }
  61. // 處理虛歲在1到40之間的情況
  62. if (age <= 40)
  63. {
  64. return $" {age}歲 {age + 60}歲";
  65. }
  66. // 其他情況直接返回虛歲
  67. return $" {age}歲";
  68. }
  69. }
  70. public static void change_Secen(int _screenNum)
  71. {
  72. SceneManager.LoadScene(_screenNum);
  73. }
  74. public static void 截圖()
  75. {
  76. string fileName = string.Format("{0}/screenshot_{1}.png", Application.persistentDataPath, System.DateTime.Now.ToString("yyyyMMdd_HHmmss"));
  77. ScreenCapture.CaptureScreenshot(fileName);
  78. }
  79. }