170 lines
4.9 KiB
C#
170 lines
4.9 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using UnityEngine;
|
|
using UnityEngine.Networking;
|
|
|
|
public class DataManager : SingleTon<DataManager>
|
|
{
|
|
public int NextScene = -1;
|
|
public List<RowsItem> peoples = new List<RowsItem>();
|
|
public List<StudentTestDataItem> studentsTest = new List<StudentTestDataItem>();
|
|
public RowsItem currentSelectPeople = null;
|
|
public StudentTestDataItem currentSelectTest = null;
|
|
|
|
public List<StudentInfoDataItem> studentInfoDataItems = new List<StudentInfoDataItem>();
|
|
public StudentInfoDataItem currentSelectStudent;
|
|
|
|
public List<DataItem> currentPeoplesProgress = new List<DataItem>();
|
|
|
|
public Dictionary<int,bool> currentDisDistance = new Dictionary<int,bool>();
|
|
|
|
public List<DataItem2> currentPeoplesQuestion = new List<DataItem2>();
|
|
public QuestionType currentQuesitionType;
|
|
|
|
private GameData gameData = null;
|
|
|
|
public DataItem2 currentQuitQuestion = null;
|
|
|
|
public Dictionary<int, List<QuestionItem>> currentAllQuestion = new Dictionary<int, List<QuestionItem>>();
|
|
|
|
public List<AnswerQuestionData> currentAllDoneQuestion = new List<AnswerQuestionData>();
|
|
|
|
public List<RoomDataItem> roomsData = new List<RoomDataItem>();
|
|
public RoomDataItem roomItem = null;
|
|
public RoomPersonsItem RoomPersonsItem = null;
|
|
|
|
public List<BodyPosInfoDataItem> bodyPosInfos = new List<BodyPosInfoDataItem>();
|
|
public List<DataItem3> currentTalk = null;
|
|
/// <summary>
|
|
/// µ±Ç°Õï¶ÏÊý¾Ý
|
|
/// </summary>
|
|
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<DataItem2> currentAnswerQuestion = new List<DataItem2>();
|
|
public List<DataItem2> checkBodyQuestion = new List<DataItem2>();
|
|
|
|
public string currentHistoryChoose = "";
|
|
|
|
public HistoryType currentHistoryType;
|
|
|
|
public bool isAddEventRTVoice = false;
|
|
|
|
public int CurrentHistoryUIID = -1;
|
|
|
|
public Dictionary<int, List<int>> peopleDisProgress = new Dictionary<int, List<int>>();
|
|
|
|
/// <summary>
|
|
/// È«²¿²¡È˵ĸöÈË×ÊÁÏ
|
|
/// </summary>
|
|
public List<RowsItem2> rowitems2 = new List<RowsItem2>();
|
|
|
|
/// <summary>
|
|
/// µ±Ç°²¡È˵ĸöÈË×ÊÁÏ
|
|
/// </summary>
|
|
public RowsItem2 peopleInfo = new RowsItem2();
|
|
|
|
/// <summary>
|
|
/// È«²¿²¡È˵Ä×ÉѯÀíÓÉ
|
|
/// </summary>
|
|
public List<AskItem> askItems = new List<AskItem>();
|
|
|
|
/// <summary>
|
|
/// µ±Ç°×ËÊÆ²¿Î»Êý¾Ý
|
|
/// </summary>
|
|
public List<BodyInfoDataItem> bodyInfoData = new List<BodyInfoDataItem>();
|
|
|
|
public List<HistoryInfoItem> historyInfoItems = new List<HistoryInfoItem>();
|
|
|
|
|
|
public List<LifeTypeItem> lifeItems = new List<LifeTypeItem>();
|
|
|
|
public List<HealingItem> healingItems = new List<HealingItem>();
|
|
|
|
public List<CheckReasonItem> checkReasonItems = new List<CheckReasonItem>();
|
|
|
|
public List<OtherInfo1Data> otherInfoItem = new List<OtherInfo1Data>();
|
|
|
|
public List<AllStyleItem> currentStyleItem = new List<AllStyleItem>();
|
|
|
|
public List<BodyNumItem> bodyNum = new List<BodyNumItem>();
|
|
|
|
|
|
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<GameData>();
|
|
}
|
|
return gameData;
|
|
}
|
|
}
|
|
public class AnswerQuestionData
|
|
{
|
|
public int questionID;
|
|
|
|
public DataItem2 question;
|
|
|
|
/// <summary>
|
|
/// 1 µ¥Ñ¡ 2¶àÑ¡ 3¿ª·Å
|
|
/// </summary>
|
|
public int type;
|
|
|
|
public int chooseOne;
|
|
|
|
public List<int> choose;
|
|
|
|
public string hint;
|
|
|
|
public string answerStr;
|
|
}
|
|
public enum QuestionType
|
|
{
|
|
/// <summary>
|
|
/// ÁÙ´²¼ì²éÎÊÌâ code=1
|
|
/// </summary>
|
|
CLINICAL_PROBLEM = 1,
|
|
/// <summary>
|
|
/// Õï¶ÏÎÊÌâ code =2
|
|
/// </summary>
|
|
DIAGNOSE_PROBLEM = 2,
|
|
/// <summary>
|
|
/// ½¨ÒéÎÊÌâ code=3
|
|
/// </summary>
|
|
SUGGEST_PROBLEM = 3,
|
|
/// <summary>
|
|
/// ×Éѯ½áÊø code=4
|
|
/// </summary>
|
|
TALK_OVER = 4,
|
|
/// <summary>
|
|
/// Í˳ö¼ì²éÎÊÌâ code=4
|
|
/// </summary>
|
|
EXIT_PROBLEM = 5
|
|
} |