12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using LitJson;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using XRTool.Util;
- public class HttpSDKAction : Singleton<HttpSDKAction>
- {
- //原始数据
- public string jsonData = "";
- //登录
- public string loginUrl = "";
- //业务逻辑
- public string managerUrl = "";
- //点云
- public string pointCloudUrl = "";
- //房间socket
- public string roomSocket = "";
- //大厅socket
- public string officeSocket = "";
- public void check(string acc)
- {
- try
- {
- if (jsonData != "")
- {
- Debug.Log("检查是否有白名1单" + jsonData);
- JsonData data = JsonMapper.ToObject(jsonData);
- Debug.Log("检查是否有白名2单" + data["unity"]["user"].ToJson());
- if (data["unity"]["user"]!=null&& data["unity"]["user"].Count>0)
- {
- Debug.Log("检查是否有白名3单"+acc);
- if(data["unity"]["user"].Keys.Contains(acc))
- {
- HttpSDKAction.Instance.loginUrl = data["unity"]["url"][data["unity"]["user"][acc].ToString()]["login"].ToString();
- HttpSDKAction.Instance.managerUrl = data["unity"]["url"][data["unity"]["user"][acc].ToString()]["manager"].ToString();
- HttpSDKAction.Instance.officeSocket = data["unity"]["url"][data["unity"]["user"][acc].ToString()]["officeSocket"].ToString();
- HttpSDKAction.Instance.pointCloudUrl = data["unity"]["url"][data["unity"]["user"][acc].ToString()]["pointCloud"].ToString();
- HttpSDKAction.Instance.roomSocket = data["unity"]["url"][data["unity"]["user"][acc].ToString()]["roomSocket"].ToString();
- Debug.Log("检查是否有白名4单" + HttpSDKAction.Instance.loginUrl);
- return;
- }
- }
- }
- }
- catch
- {
- }
- }
- }
|