private void _OnCompleteDownload(IDownloadedItem wItem, object obj) { try { if (!wItem.canAccessString) { if (wItem.canAccessBytes) { using (TsDataReader tsDataReader = new TsDataReader()) { float realtimeSinceStartup = Time.realtimeSinceStartup; bool flag; if (this.m_bReadImmediate) { flag = tsDataReader.LoadFromImmediate(wItem.safeBytes, "[Table]", new TsDataReader.RowDataCallback(this.ParseDataFromNDTImmediate)); } else if (tsDataReader.LoadFrom(wItem.safeBytes)) { tsDataReader.BeginSection("[Table]"); flag = this.ParseDataFromNDT(tsDataReader); } else { flag = false; } if (!flag) { } float num = Time.realtimeSinceStartup - realtimeSinceStartup; UIDataManager.fTotalTime += num; } } else if (wItem.mainAsset != null) { GameObject gameObject = wItem.mainAsset as GameObject; TsGameDataAdapter component = gameObject.GetComponent <TsGameDataAdapter>(); TsGameData gameData = component.GameData; this.ParseDataFromBundle(gameData); wItem.unloadImmediate = true; } } } catch (Exception message) { Debug.LogError(message); } finally { this.SetFinishProcess(); } }
public GameObject[] ReadXML(IDownloadedItem wItem, object obj) { if (wItem.mainAsset == null) { TsLog.LogWarning("wItem.mainAsset is null -> Path = {0}", new object[] { wItem.assetPath }); } else { GameObject gameObject = wItem.mainAsset as GameObject; if (null != gameObject) { TsGameDataAdapter component = gameObject.GetComponent <TsGameDataAdapter>(); TsGameData gameData = component.GameData; return(this.ReadXML(gameData.serializeGameDatas[0])); } wItem.unloadImmediate = true; } return(null); }
public void ReadXML(IDownloadedItem wItem, object kParmObj) { XmlReader xmlReader = null; if (wItem.canAccessString) { MemoryStream stream = new MemoryStream(NrXmlSerializer.StringToUTF8ByteArray(wItem.safeString)); xmlReader = XmlReader.Create(stream); } else if (wItem.canAccessAssetBundle) { GameObject gameObject = wItem.mainAsset as GameObject; if (null != gameObject) { TsGameDataAdapter component = gameObject.GetComponent <TsGameDataAdapter>(); TsGameData gameData = component.GameData; MemoryStream stream2 = new MemoryStream(NrXmlSerializer.StringToUTF8ByteArray(gameData.serializeGameDatas[0])); xmlReader = XmlReader.Create(stream2); } wItem.unloadImmediate = true; } if (xmlReader == null) { return; } try { while (xmlReader.Read()) { if (xmlReader.NodeType == XmlNodeType.Element && !xmlReader.IsEmptyElement) { if (xmlReader.Name == typeof(Camera).Name) { CutScene_Camera cutScene_Camera = new CutScene_Camera(); cutScene_Camera.CameraName = xmlReader.GetAttribute("Name"); int fov = 35; if (int.TryParse(xmlReader.GetAttribute("FOV"), out fov)) { cutScene_Camera._fov = fov; } else { cutScene_Camera._fov = 35; Debug.LogError("Cannot find XML Setting : FOV Default Settings -> 35"); } this.ReadCamera(xmlReader, ref cutScene_Camera); this._listCamera.Add(cutScene_Camera); } else if (xmlReader.Name == "USequenceData") { string attribute = xmlReader.GetAttribute("Duration"); this.Duration = float.Parse(attribute); } } } this.SortCameraTimeLine(); } catch (Exception ex) { TsLog.LogError(ex.Message + " " + ex.StackTrace, new object[0]); return; } if (this.nReservationCharKind == 0 && this.eReservationAni == eCharAnimationType.None) { this.StartCutScene(); } this.bLoadComplete = true; }