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);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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]));
            }
        }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
        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);
                }
            }
        }
Ejemplo n.º 6
0
        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);
            }
        }
Ejemplo n.º 7
0
        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);
                }
            }
        }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
        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);
        }
Ejemplo n.º 11
0
        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);
            }
        }
Ejemplo n.º 12
0
 public AssetDataGroup(SerializeData data)
 {
     m_Key = data.key;
     SetSerizlizeData(data);
 }
Ejemplo n.º 13
0
 public AssetDataPackage(SerializeData data, string path)
 {
     m_FolderPath = path;
     SetSerizlizeData(data);
 }