예제 #1
0
        public override void DeSerialize(DataReader data)
        {
            header.DeSerialize(data);
            data.byteOrder = DataReader.ByteOrder.Little;
            UnityVersion   = data.ReadStringNull();
            attributes     = data.ReadInt32();

            numOfTypeTrees = data.ReadInt32();
            typeTrees      = new SerializeTypeTree[numOfTypeTrees];

            for (int i = 0; i < numOfTypeTrees; i++)
            {
                typeTrees[i] = new SerializeTypeTree();
                typeTrees[i].DeSerialize(data);
            }
            //padding
            data.ReadInt32();

            numOfObjects = data.ReadInt32();
            objectInfos  = new SerializeAssetObject[numOfObjects];
            for (int i = 0; i < numOfObjects; i++)
            {
                objectInfos[i] = new SerializeAssetObject((int)header.DataOffset);
                objectInfos[i].DeSerialize(data);
            }

            numOfFileIdentifiers = data.ReadInt32();
            fileIdentifiers      = new SerializeFileIdentifier[numOfFileIdentifiers];
            for (int i = 0; i < numOfFileIdentifiers; i++)
            {
                fileIdentifiers[i] = new SerializeFileIdentifier();
                fileIdentifiers[i].DeSerialize(data);
            }
        }
        public override void DeSerialize(DataReader data)
        {

            header.DeSerialize(data);
            data.byteOrder = DataReader.ByteOrder.Little;
            UnityVersion = data.ReadStringNull();
            attributes = data.ReadInt32();

            numOfTypeTrees = data.ReadInt32();
            typeTrees = new SerializeTypeTree[numOfTypeTrees];
            
            for (int i = 0; i < numOfTypeTrees; i++) {
                typeTrees[i] = new SerializeTypeTree();
                typeTrees[i].DeSerialize(data);
            }
            //padding
            data.ReadInt32();

            numOfObjects = data.ReadInt32();
            objectInfos = new SerializeAssetObject[numOfObjects];
            for (int i = 0; i < numOfObjects; i++) {
                objectInfos[i] = new SerializeAssetObject((int)header.DataOffset);
                objectInfos[i].DeSerialize(data);
            }

            numOfFileIdentifiers = data.ReadInt32();
            fileIdentifiers = new SerializeFileIdentifier[numOfFileIdentifiers];
            for (int i = 0; i < numOfFileIdentifiers; i++) {
                fileIdentifiers[i] = new SerializeFileIdentifier();
                fileIdentifiers[i].DeSerialize(data);
            }
        }
예제 #3
0
        public override void DeSerialize(DataReader br)
        {
            header.DeSerialize(br);
            br.byteOrder     = DataReader.ByteOrder.Little;
            UnityVersion     = br.ReadStringNull();
            attributes       = br.ReadInt32();
            embedded         = br.ReadBool();
            numOfBaseClasses = br.ReadInt32();
            classes          = new SerializeTypeTreeData[numOfBaseClasses];
            for (int i = 0; i < numOfBaseClasses; i++)
            {
                classes[i] = new SerializeTypeTreeData(embedded);
                classes[i].DeSerialize(br);
            }

            numOfObjects = br.ReadInt32();
            objectInfos  = new SerializeAssetObject[numOfObjects];
            for (int i = 0; i < numOfObjects; i++)
            {
                objectInfos[i] = new SerializeAssetObject((int)header.DataOffset);
                objectInfos[i].DeSerialize(br);
            }

            numOfObjectIdentifiers = br.ReadInt32();
            objectIdentifiers      = new SerializeObjectIdentifier[numOfObjectIdentifiers];
            for (int i = 0; i < numOfObjectIdentifiers; i++)
            {
                objectIdentifiers[i] = new SerializeObjectIdentifier();
                objectIdentifiers[i].DeSerialize(br);
            }

            numOfFileIdentifiers = br.ReadInt32();
            fileIdentifiers      = new SerializeFileIdentifier[numOfFileIdentifiers];
            for (int i = 0; i < numOfFileIdentifiers; i++)
            {
                fileIdentifiers[i] = new SerializeFileIdentifier();
                fileIdentifiers[i].DeSerialize(br);
            }
        }
        public override  void DeSerialize(DataReader br)
        {

            header.DeSerialize(br);
            br.byteOrder = DataReader.ByteOrder.Little;
            UnityVersion = br.ReadStringNull();
            attributes = br.ReadInt32();
            embedded = br.ReadBool();
            numOfBaseClasses = br.ReadInt32();
            classes = new SerializeTypeTreeData[numOfBaseClasses];
            for (int i = 0; i < numOfBaseClasses; i++) {
                classes[i] = new SerializeTypeTreeData(embedded);
                classes[i].DeSerialize(br);
            }

            numOfObjects = br.ReadInt32();
            objectInfos = new SerializeAssetObject[numOfObjects];
            for (int i = 0; i < numOfObjects; i++) {
                objectInfos[i] = new SerializeAssetObject((int)header.DataOffset);
                objectInfos[i].DeSerialize(br);
            }

            numOfObjectIdentifiers = br.ReadInt32();
            objectIdentifiers = new SerializeObjectIdentifier[numOfObjectIdentifiers];
            for (int i = 0; i < numOfObjectIdentifiers; i++) {
                objectIdentifiers[i] = new SerializeObjectIdentifier();
                objectIdentifiers[i].DeSerialize(br);
            }

            numOfFileIdentifiers = br.ReadInt32();
            fileIdentifiers = new SerializeFileIdentifier[numOfFileIdentifiers];
            for (int i = 0; i < numOfFileIdentifiers; i++) {
                fileIdentifiers[i] = new SerializeFileIdentifier();
                fileIdentifiers[i].DeSerialize(br);
            }
        }