IEnumerator LoadLocalJson() { //Debug.Log("111"); WWW www = new WWW(Application.dataPath + "/Resources/ConfigProfiles/CriteriaInfo.json"); yield return(www); Debug.Log(www.text); ListCritera = JsonConvert.DeserializeObject <CriteriaList>(www.text); www = new WWW(Application.dataPath + "/Resources/ConfigProfiles/MachineInfo.json"); yield return(www); Debug.Log(www.text); ListMachine = JsonConvert.DeserializeObject <MachineList>(www.text); www = new WWW(Application.dataPath + "/Resources/ConfigProfiles/SubCriteriaInfo.json"); yield return(www); Debug.Log(www.text); ListSubCriteria = JsonConvert.DeserializeObject <SubCriteriaList>(www.text); www = new WWW(Application.dataPath + "/Resources/ConfigProfiles/AspectInfo.json"); yield return(www); Debug.Log(www.text); ListAspect = JsonConvert.DeserializeObject <AspectList>(www.text); OnInitStatisticsData(); }
public void LoadAllData() { //StartCoroutine(LoadLocalJson()); TextAsset str1 = Resources.Load <TextAsset>("ConfigProfiles/CriteriaInfo"); TextAsset str2 = Resources.Load <TextAsset>("ConfigProfiles/MachineInfo"); TextAsset str3 = Resources.Load <TextAsset>("ConfigProfiles/SubCriteriaInfo"); TextAsset str4 = Resources.Load <TextAsset>("ConfigProfiles/AspectInfo"); ListCritera = JsonConvert.DeserializeObject <CriteriaList>(str1.text); ListMachine = JsonConvert.DeserializeObject <MachineList>(str2.text); ListSubCriteria = JsonConvert.DeserializeObject <SubCriteriaList>(str3.text); ListAspect = JsonConvert.DeserializeObject <AspectList>(str4.text); OnInitStatisticsData(); }