private void ParseData(AssetsFile file, int version) { if (version > 15) { if (_fileTypeOrIndex < file.TypeTree.Types.Count) { var type = file.TypeTree.Types[_fileTypeOrIndex]; if (type.ScriptIndex == -1) { ClassID = (AssetCodes)type.ClassID; InheritedUnityClass = type.ClassID; ScriptIndex = -1; } else { ClassID = (AssetCodes)type.ClassID; InheritedUnityClass = type.ClassID; ScriptIndex = type.ScriptIndex; } } else { throw new NotImplementedException(); } } _absolutePosition = file.Header.AssetsOffset + _dataOffset; using (var reader = Owner.CreateReader(_absolutePosition)) { _data = reader.ReadBytes((int)_dataLength); } }
private void ReadData(UnityReader reader, int version) { if (version < 14) { Index = reader.ReadUInt32(); } else { reader.Align(4); Index = reader.ReadInt64(); } _dataOffset = reader.ReadUInt32(); _dataLength = reader.ReadUInt32(); _fileTypeOrIndex = reader.ReadInt32(); if (version < 16) { ClassID = (AssetCodes)_fileTypeOrIndex; InheritedUnityClass = reader.ReadInt16(); } if (version < 17) { ScriptIndex = reader.ReadInt16(); Unknown = reader.ReadByte(); } }
public UnityTypeNode this[AssetCodes assetCode] { get { return(_typeByAssetCode[assetCode]); } }
public bool CanDeserialize(AssetCodes assetCode) { return(_typeByAssetCode.ContainsKey(assetCode)); }
public UnityTypeAttribute(AssetCodes classID) { AssetType = classID; }