GlobalConfig.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. #if UNITY_EDITOR
  5. using UnityEditor;
  6. #endif
  7. namespace AppUI.Config
  8. {
  9. [System.Serializable]
  10. public class GamePlayInfo
  11. {
  12. public string ScoreType;
  13. public int PlayTime;
  14. public int GameType;
  15. }
  16. public static class GlobalConfig
  17. {
  18. // 箭重
  19. public static readonly float[] ArrowWeights =
  20. {
  21. 20f,
  22. 27f,
  23. 30.5f
  24. };
  25. // 按钮值
  26. public static readonly int[] Buttons =
  27. {
  28. 0,
  29. 1
  30. };
  31. // 按钮文字
  32. public static readonly string[] ButtonStrs =
  33. {
  34. "ON",
  35. "OFF"
  36. };
  37. public static readonly LanguageEnum[] UILanguages =
  38. {
  39. LanguageEnum.English,
  40. LanguageEnum.Japan,
  41. LanguageEnum.Chinese
  42. };
  43. public static readonly string[] LanguageTexts =
  44. {
  45. "English",
  46. "日本語",
  47. "中文"
  48. };
  49. public static readonly int[] ShootLevels = { 0, 1, 2 };
  50. public static readonly string[] ShootLevelStrs = { "Easy", "Normal", "Hard" };
  51. /// <summary>
  52. /// 用于版本文案等展示:真机读 <see cref="Application.platform"/>;Editor 读 Build Target(避免 WindowsEditor)。
  53. /// </summary>
  54. public static string GetPlatformDisplayName()
  55. {
  56. #if UNITY_EDITOR
  57. switch (EditorUserBuildSettings.activeBuildTarget)
  58. {
  59. case BuildTarget.Android:
  60. return "Android";
  61. case BuildTarget.iOS:
  62. return "iOS";
  63. default:
  64. return "Android";
  65. }
  66. #else
  67. switch (Application.platform)
  68. {
  69. case RuntimePlatform.Android:
  70. return "Android";
  71. case RuntimePlatform.IPhonePlayer:
  72. return "iOS";
  73. default:
  74. return Application.platform.ToString();
  75. }
  76. #endif
  77. }
  78. }
  79. }