protected void SetSerizlizeData(SerializeData data) { if (data == null || data.AssetDataGroup == null) { return; } for (int i = data.AssetDataGroup.Length - 1; i >= 0; --i) { mAllAssetDataGroup.Add(BuildAssetDataGroup(data.AssetDataGroup[i])); } if (mAssetDataTable == null) { mAssetDataTable = new AssetDataTable(); foreach (var serializeData in data.AssetDataGroup) { foreach (var assetData in serializeData.assetDataArray) { mAssetDataTable.Add(assetData); } } } }
public void Save(string outPath) { SerializeData sd = new SerializeData(); sd.abUnitArray = mABUnitArray.ToArray(); if (mAssetDataMap != null) { AssetData[] acArray = new AssetData[mAssetDataMap.Count]; int index = 0; foreach (var item in mAssetDataMap) { acArray[index++] = item.Value; } sd.assetDataArray = acArray; } if (SerializeHelper.SerializeBinary(outPath, sd)) { Log.I("Success Save AssetDataTable:" + outPath); } else { Log.E("Failed Save AssetDataTable:" + outPath); } }
private void SetSerizlizeData(SerializeData data) { if (data == null || data.AssetDataGroup == null) { return; } for (int i = data.AssetDataGroup.Length - 1; i >= 0; --i) { m_AllAssetDataGroup.Add(BuildAssetDataGroup(data.AssetDataGroup[i])); } }
public void Save(string outFolder) { SerializeData sd = GetSerializeData(); // string outPath = string.Format("{0}{1}/{2}", outFolder, m_ExportPath, ProjectPathConfigTemp.EXPORT_ASSETBUNDLE_CONFIG_PATH); string outPath = string.Format("{0}", outFolder); if (SerializeHelper.SerializeBinary(outPath, sd)) { Log.i("Success Save AssetDataTable:" + outPath); } else { Log.e("Failed Save AssetDataTable:" + outPath); } }
private void SetSerializeData(SerializeData data) { if (data == null) { return; } mABUnitArray = new List <ABUnit>(data.abUnitArray); if (data.assetDataArray != null) { mAssetDataMap = new Dictionary <string, AssetData>(); foreach (var config in data.assetDataArray) { AddAssetData(config); } } }
public void Save(string outPath) { SerializeData sd = new SerializeData(); sd.AssetDataGroup = new AssetDataGroup.SerializeData[m_AllAssetDataGroup.Count]; for (int i = 0; i < m_AllAssetDataGroup.Count; ++i) { sd.AssetDataGroup[i] = m_AllAssetDataGroup[i].GetSerializeData(); } if (SerializeHelper.SerializeBinary(outPath, sd)) { Log.I("Success Save AssetDataTable:" + outPath); } else { Log.E("Failed Save AssetDataTable:" + outPath); } }
private void SetSerizlizeData(SerializeData data) { if (data == null) { return; } mABUnitArray = new List <ABUnit>(data.abUnitArray); if (data.assetDataArray != null) { mAssetDataMap = new Dictionary <string, AssetData>(); for (int i = 0; i < data.assetDataArray.Length; ++i) { AssetData config = data.assetDataArray[i]; AddAssetData(config); } } }
public SerializeData GetSerializeData() { SerializeData sd = new SerializeData(); sd.key = m_Key; sd.abUnitArray = mABUnitArray.ToArray(); if (mAssetDataMap != null) { AssetData[] acArray = new AssetData[mAssetDataMap.Count]; int index = 0; foreach (var item in mAssetDataMap) { acArray[index++] = item.Value; } sd.assetDataArray = acArray; } return(sd); }
public void LoadFromFile(string path) { object data = SerializeHelper.DeserializeBinary(FileMgr.Instance.OpenReadStream(path)); if (data == null) { Log.E("Failed Deserialize AssetDataTable:" + path); return; } SerializeData sd = data as SerializeData; if (sd == null) { Log.E("Failed Load AssetDataTable:" + path); return; } Log.I("Load AssetConfig From File:" + path); SetSerizlizeData(sd); }
public void LoadFromFile(string path) { object data = SerializeHelper.DeserializeBinary(path); if (data == null) { Log.E("Failed Deserialize AssetDataTable:" + path); return; } SerializeData sd = data as SerializeData; if (sd == null) { Log.E("Failed Load AssetDataTable:" + path); return; } Reset(); SetSerizlizeData(sd); }
public void Save(string outPath) { var sd = new SerializeData { AssetDataGroup = new AssetDataGroup.SerializeData[mAllAssetDataGroup.Count] }; for (var i = 0; i < mAllAssetDataGroup.Count; ++i) { sd.AssetDataGroup[i] = mAllAssetDataGroup[i].GetSerializeData(); } if (ResKit.Architecture.Interface.GetUtility <IBinarySerializer>() .SerializeBinary(outPath, sd)) { Log.I("Success Save AssetDataTable:" + outPath); } else { Log.E("Failed Save AssetDataTable:" + outPath); } }
public AssetDataGroup(SerializeData data) { m_Key = data.key; SetSerizlizeData(data); }
public AssetDataPackage(SerializeData data, string path) { m_FolderPath = path; SetSerizlizeData(data); }