UserManager.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using Newtonsoft.Json.Linq;
  2. using SC.XR.Unity;
  3. using UnityEngine;
  4. public class UserManager : SingletonMono<UserManager>
  5. {
  6. public void loginBack(bool isLogin)
  7. {
  8. if (isLogin)
  9. {
  10. UserSceneManager.Instance.callback += (bool b) => {
  11. //初始化场景结束
  12. if(b)
  13. {
  14. GameScene.Instance.ShowScenes();
  15. }
  16. };
  17. UIManager.Instance.ShowUI(UINameConfig.LoadingPanel, typeof(LoadingPanel), (int)ELoadState.getMaterialValue);
  18. HttpTool.Instance.GetAllMaterials(HttpAction.material_init, "", (string msgMater)=> {
  19. Debug.Log("/material/init===>" + msgMater);
  20. ModelManager.Instance.init(msgMater);
  21. UIManager.Instance.ShowUI(UINameConfig.LoadingPanel, typeof(LoadingPanel), (int)ELoadState.getAllScene);
  22. HttpTool.Instance.Get(HttpAction.project_init, (string msg) => {
  23. Debug.Log("/project/index===>" + msg);
  24. StartCoroutine( UserSceneManager.Instance.initScene(msg));
  25. // GameScene.Instance.ShowScenes();
  26. });
  27. });
  28. /*
  29. HttpTool.Instance.Get(HttpAction.viewpoint_init, (string msg) => {
  30. Debug.Log("/project/viewpoint_init===>" + msg);
  31. });*/
  32. }
  33. }
  34. }