CommonConfig.cs 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. /**通用配置(2021/12/18新增) */
  6. public class CommonConfig
  7. {
  8. //青凤鸾 WONDERFITTER ,WONDER FITTER Pro ,WONDER FITTER 运动
  9. public static readonly string[] AppNames = { "WONDERFITTER Pro 运动", "WONDER FITTER Pro", "WONDERFITTER PRO B" };
  10. //App地区(0:国内版;1:海外版;)
  11. public static int AppArea
  12. {
  13. get
  14. {
  15. //Application.identifier.Contains("com.xmjssvr.BowArrow.mi")
  16. //int index = Application.identifier == "com.xmjssvr.BowArrow" ? 0 : 1; // Array.IndexOf(AppNames, Application.productName);
  17. #if UNITY_IOS
  18. int index = Application.identifier == "com.xmjssvr.BowArrow" ? 0 : 1;//海外版 com.xmjssvr.BowArrowEn
  19. #endif
  20. #if UNITY_ANDROID
  21. int index = 0;
  22. if (StandaloneModeOrPlatformB)
  23. {
  24. //b端
  25. index = Application.identifier == "com.xmjssvr.BowArrow.miBClient" ? 0 : 1;//海外版 com.xmjssvr.BowArrowEn
  26. }
  27. else {
  28. index = Application.identifier == "com.xmjssvr.BowArrow.mi" ? 0 : 1;//海外版 com.xmjssvr.BowArrowEn
  29. }
  30. #endif
  31. #if UNITY_STANDALONE_WIN
  32. //pc版
  33. int index = 0;
  34. #endif
  35. if (index == 0) return 0;
  36. else return 1;
  37. }
  38. }
  39. //根据产品名决定默认语言
  40. public static int AppLanguage { get => AppArea; }
  41. //禁止语言切换(ios安全上架)
  42. // public static bool banLanguageChangeSwitch { get => Application.platform == RuntimePlatform.IPhonePlayer; }
  43. public static bool banLanguageChangeSwitch { get => false; }
  44. //禁止绑定关联账号的相关功能(找回密码,注册界面绑定手机邮箱,个人界面绑定手机邮箱)
  45. // public static bool banBindRelateAccount { get => Application.platform == RuntimePlatform.IPhonePlayer; }
  46. public static bool banBindRelateAccount { get => false; }
  47. public static bool iosTaoKe = false; //IOS套壳开关
  48. public static bool ReleaseVersion2 = true;
  49. /*
  50. 特定版本功能
  51. 1、长接瞄准键,出来鼠标的功能帮忙去掉
  52. 2、在初始状态下,就装备上五倍射程卡和二倍瞄准镜
  53. 3、将60寸,2.5米的5倍数更改为60寸,1.5米的3倍数
  54. 4、进入游戏时,默认加开启射程卡
  55. */
  56. public static bool SpecialVersion1 = true;
  57. //需要App商店审核?-标记用于特别处理某些功能
  58. public static bool needToExamine = false;
  59. //是否属于发布版本?-标记用于特别处理某些功能,比如屏蔽内部测试才有功能
  60. public static bool isReleaseVersion = false;
  61. //设备方案
  62. public static int devicePlan = 3;
  63. /**环数精度小数位 */
  64. public static readonly int ringsPrecision = 1;
  65. /**箭的速度精度小数位 */
  66. public static readonly int arrowSpeedPrecision = 1;
  67. //实体模具箭重,单位克
  68. public static float arrowWeight = 75;
  69. #region 校准引导时候。校准的时间
  70. /**弓箭方案时间 */
  71. public static float calibrationTimeArchery { get; } = 10;
  72. /**枪时间*/
  73. public static float calibrationTimeGun { get; } = 10;
  74. #endregion
  75. public enum ServerType { LocalTest, Produce, Test };
  76. private static ServerType serverType = ServerType.Produce;
  77. //网关服务器访问地址
  78. public static string gateServerURL
  79. {
  80. get
  81. {
  82. if (serverType == ServerType.Produce)
  83. {
  84. Debug.Log("****************** 正式服务器: " + serverIndex + " ********************");
  85. if (serverIndex == 0)
  86. return "https://www.xmjssvr.com/SmartBowBusinessServer";//"http://118.195.187.121/SmartBowBusinessServer";等备案再使用域名
  87. else if (serverIndex == 1)
  88. return "https://www.wonderfittervr.com/SmartBowBusinessServer";//"http://54.165.56.200/SmartBowBusinessServer";
  89. }
  90. else if (serverType == ServerType.Test)
  91. {
  92. Debug.Log("****************** 测试服务器 ********************");
  93. //测试服务器
  94. return "http://www.b-beng.com/SmartBowBusinessServer";
  95. }
  96. return "http://192.168.0.105:11432/SmartBowBusinessServer";
  97. }
  98. }
  99. //业务服务端WS访问地址
  100. public static string businessServerWsURL;
  101. //游戏对战服务器
  102. public static string gamePKServerWsURL;
  103. public static int serverIndex { get => AppArea; }
  104. /// <summary>
  105. /// 弓箭SDK的服务端地址
  106. /// </summary>
  107. public static readonly string SmartBowSdkURL = "http://43.132.127.96/SmartBowBusinessServer";
  108. #region 根据不同平台不同版本配置打包 bool
  109. /// <summary>
  110. /// 单机模式是否开启
  111. /// </summary>
  112. public static bool StandaloneMode { get; } = true; // 默认false
  113. /// <summary>
  114. /// 是否开启设备验证。
  115. /// 暂时Pc开启验证
  116. /// </summary>
  117. #if UNITY_STANDALONE_WIN || UNITY_EDITOR
  118. public static bool EnableDecryption = false; // 默认true
  119. #else
  120. public static bool EnableDecryption = false;
  121. #endif
  122. /// <summary>
  123. /// 是否打包红外软件App,这里主要和九轴有区别
  124. /// </summary>
  125. public static bool bInfraredApp { get; } = true;
  126. //打包App 的端,比如打包B 端就设置 B
  127. public static OperatingPlatform OP { get; } = OperatingPlatform.B;
  128. //是否是投币功能
  129. public static bool bSupportCoin { get; } = true;
  130. //是否禁用蓝牙(目前是b端端口连接情况下设置)
  131. public static bool bDisableBluetooth { get; } = true;
  132. /// <summary>
  133. /// 视频链接区分
  134. /// </summary>
  135. public static bool bInfraredURL { get; } = true;
  136. /// <summary>
  137. /// 是否播放默认视频
  138. /// </summary>
  139. public static bool bPlayDefaultVideo { get; } = true;
  140. /// <summary>
  141. /// 是否不判断二维码
  142. /// 打开无QRCode时候的激光器,有支付盒子需要设置false
  143. /// </summary>
  144. public static bool bOpenTheLaserWithoutQRCode { get; } = false;
  145. #endregion
  146. //单机版,B端,投币功能
  147. public static bool StandaloneModeOrPlatformB { get => StandaloneMode && OP == OperatingPlatform.B && bSupportCoin; }
  148. }
  149. //打包App 的端
  150. public enum OperatingPlatform
  151. {
  152. //A端
  153. A,
  154. //B端
  155. B,
  156. //C端
  157. C,
  158. }