CommonConfig.cs 5.5 KB

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