HttpAction.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. using LitJson;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class HttpAction :Singleton<HttpAction>
  6. {
  7. public string officeport
  8. {
  9. get
  10. {
  11. try
  12. {
  13. if (HttpSDKAction.Instance.jsonData != "")
  14. {
  15. string pt = "pro";
  16. #if UNITY_EDITOR
  17. pt = "dev";
  18. #endif
  19. JsonData data = JsonMapper.ToObject(HttpSDKAction.Instance.jsonData);
  20. if (data["unity"]["url"][pt] != null)
  21. {
  22. return data["unity"]["url"][pt]["officePort"].ToString();
  23. }
  24. else
  25. {
  26. return "1883";
  27. }
  28. }
  29. else
  30. {
  31. return "1883";
  32. }
  33. }
  34. catch
  35. {
  36. return "1883";
  37. }
  38. }
  39. }
  40. public string mqtturl
  41. {
  42. get
  43. {
  44. if (HttpSDKAction.Instance.officeSocket == "")
  45. {
  46. HttpSDKAction.Instance.officeSocket = "api-fat1.ghz-tech.com";
  47. }
  48. return HttpSDKAction.Instance.officeSocket;
  49. }
  50. }
  51. public string baseurl20
  52. {
  53. get
  54. {
  55. if (HttpSDKAction.Instance.loginUrl == "")
  56. {
  57. // HttpSDKAction.Instance.loginUrl = "https://api-fat2.ghz-tech.com/mr-navigator/v1";
  58. // HttpSDKAction.Instance.loginUrl = HttpSDKAction.Instance.managerUrl;
  59. }
  60. return HttpSDKAction.Instance.loginUrl;
  61. }
  62. }
  63. public string baseurl
  64. {
  65. get
  66. {
  67. if (HttpSDKAction.Instance.loginUrl == "")
  68. {
  69. // HttpSDKAction.Instance.loginUrl = "https://api-fat2.ghz-tech.com/mr-navigator/v1";
  70. // HttpSDKAction.Instance.loginUrl = HttpSDKAction.Instance.managerUrl;
  71. }
  72. return HttpSDKAction.Instance.loginUrl;
  73. }
  74. }
  75. //初始化场景
  76. public const string client_snInfo = "/client/snInfo";
  77. //public const string project_detail = "/project/detail";
  78. //初始化景点
  79. public const string sn_init = "/sn/init";
  80. //下载
  81. public const string file_download = "/file/download";
  82. //获取资源
  83. public const string material_init = "/material/init";
  84. //获取账号下场景id
  85. public const string project_init = "/project/index";
  86. //保存景点位
  87. public const string viewpoint_update = "/viewpoint/update";
  88. //电量
  89. public const string sn_electricity = "/sn/electricity";
  90. //识别的景点
  91. public const string sn_viewpoint = "/sn/viewpoint";
  92. // 偏移角
  93. public const string refrence = "/project/unityReference";
  94. public const string pointcloud = "/project/pointcloudInfo";
  95. }