IEnumerator ReadConfigFileGlobal(string tablename) { loadStep++; string filename = tablename + fileNameStr; string filepath = GetConfigFilePath(filename); WWW www = new WWW(filepath); yield return(www); while (www.isDone == false) { yield return(null); } if (www.error == null) { string data = www.text; DeserializeGlobal cfgDeserializeClass = JsonUtility.FromJson <DeserializeGlobal>(data); List <ConfigClass> cfgList = new List <ConfigClass>(cfgDeserializeClass.cfgArray); CfgTabelData.GetInstance().WriteData(tablename, cfgList); } else { Debug.LogError("wwwError<<" + www.error + "<<" + filepath); } loadStep--; if (loadStep <= 0) { LoadMgr._instance.loadNum--; } }
private void Awake() { if (roteSpeed == 0) { Global _global = CfgTabelData.GetInstance().GetCfgTabelByName("Global").getDataByID(1) as Global; roteSpeed = _global.bgRoteSpeed; } }