WebController.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using LitJson;
  6. public class WebController
  7. {
  8. private static WebController _Instance;
  9. public static WebController Instance
  10. {
  11. get
  12. {
  13. if (WebController._Instance == null) WebController._Instance = new WebController();
  14. return WebController._Instance;
  15. }
  16. }
  17. public void Login()
  18. {
  19. MainAccountData.code = MainAccountData.LocalCode;
  20. WebManager.GetInstance.Login(() =>
  21. {
  22. //DownLoadController.GetInstance.DownUrl = GameDefine.CdnPath(MainAccountData.Instance.cdn_url);
  23. //WorldSceneManager.GetInstance.PreStart(false);
  24. });
  25. }
  26. public void GetWorldInfo(Action<JsonData> action)
  27. {
  28. WebManager.GetInstance.HttpPostRequest_Send(PROTOCOLS.worldAreaBlock, null, (jsondata) =>
  29. {
  30. if (action != null) action(jsondata);
  31. }, (jsdata) =>
  32. {
  33. });
  34. }
  35. public void ChangeScene()
  36. {
  37. var dic = new Dictionary<string, string>()
  38. {
  39. {"ground_id", "1"},{"scene_id", "USC165805685261f3add03a283"},{"source","1"}
  40. };
  41. WebManager.GetInstance.HttpPostRequest_Send(PROTOCOLS.worldSceneData, dic, (jsondata) =>
  42. {
  43. //Debug.Log(",,,,,,,,");
  44. //InDoorControoler.GetInstance.GoToInDoor
  45. //InDoorControoler.GetInstance.PreDoor("1", "USC165805685261f3add03a283", jsondata);
  46. }, (jsdata) =>
  47. {
  48. });
  49. }
  50. //"ground_id": "1",
  51. // "ground_scene_out": "USC112339683061f1072e2ba28",
  52. // 2
  53. }