CommonConfig.cs 6.5 KB

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