using System.Collections; using System.Collections.Generic; using System.Text; using UnityEngine; using UnityEngine.Networking; public class DataManager : SingleTon { public int NextScene = -1; public List peoples = new List(); public List studentsTest = new List(); public RowsItem currentSelectPeople = null; public StudentTestDataItem currentSelectTest = null; public List studentInfoDataItems = new List(); public StudentInfoDataItem currentSelectStudent; public List currentPeoplesProgress = new List(); public Dictionary currentDisDistance = new Dictionary(); public List currentPeoplesQuestion = new List(); public QuestionType currentQuesitionType; private GameData gameData = null; public DataItem2 currentQuitQuestion = null; public Dictionary> currentAllQuestion = new Dictionary>(); public List currentAllDoneQuestion = new List(); public List roomsData = new List(); public RoomDataItem roomItem = null; public RoomPersonsItem RoomPersonsItem = null; public List bodyPosInfos = new List(); public List currentTalk = null; /// /// 当前诊断数据 /// public DataItem currentData = null; public PeopleStyle currentPeopleStyle = PeopleStyle.sit_front; public StylePosType currentStylePos = StylePosType.JZX1; public CheckToolType currentCheckTool = CheckToolType.Look; public int currentBGType = 1; public List currentAnswerQuestion = new List(); public List checkBodyQuestion = new List(); public string currentHistoryChoose = ""; public HistoryType currentHistoryType; public bool isAddEventRTVoice = false; public int CurrentHistoryUIID = -1; public Dictionary> peopleDisProgress = new Dictionary>(); /// /// 全部病人的个人资料 /// public List rowitems2 = new List(); /// /// 当前病人的个人资料 /// public RowsItem2 peopleInfo = new RowsItem2(); /// /// 全部病人的咨询理由 /// public List askItems = new List(); /// /// 当前姿势部位数据 /// public List bodyInfoData = new List(); public List historyInfoItems = new List(); public List lifeItems = new List(); public List healingItems = new List(); public List checkReasonItems = new List(); public List otherInfoItem = new List(); public List currentStyleItem = new List(); public List bodyNum = new List(); public ShowMode showMode = ShowMode.PeopleTest; public IEnumerator PostData(string url,string jsondata) { byte[] databyte = Encoding.UTF8.GetBytes(jsondata); UnityWebRequest _request = new UnityWebRequest(url, UnityWebRequest.kHttpVerbPOST); _request.uploadHandler = new UploadHandlerRaw(databyte); _request.downloadHandler = new DownloadHandlerBuffer(); _request.SetRequestHeader("Content-Type", "application/json;charset=utf-8"); yield return _request.SendWebRequest(); Debug.Log(_request.responseCode); if (_request.isHttpError || _request.isNetworkError) { Debug.LogError(_request.error); } else { Debug.Log(_request.downloadHandler.text); } } public GameData GetGameData() { if (gameData == null) { gameData = GameObject.Find("GameData").GetComponent(); } return gameData; } } public class AnswerQuestionData { public int questionID; public DataItem2 question; /// /// 1 单选 2多选 3开放 /// public int type; public int chooseOne; public List choose; public string hint; public string answerStr; } public enum QuestionType { /// /// 临床检查问题 code=1 /// CLINICAL_PROBLEM = 1, /// /// 诊断问题 code =2 /// DIAGNOSE_PROBLEM = 2, /// /// 建议问题 code=3 /// SUGGEST_PROBLEM = 3, /// /// 咨询结束 code=4 /// TALK_OVER = 4, /// /// 退出检查问题 code=4 /// EXIT_PROBLEM = 5 }