public void Read(AssetsFileReader reader) { bufferedPath = reader.ReadNullTerminated(); guid = new GUID128(); guid.Read(reader); type = reader.ReadInt32(); assetPath = reader.ReadNullTerminated(); originalAssetPath = assetPath; //because lowercase "resources" is read by unity fine on linux, it either uses //hardcoded replaces like below or it has case insensitive pathing somehow //this isn't consistent with the original assetstools but it only supported //windows anyway, so this will only create issues if more than these three //pop up in the future. also, the reason I don't just replace all "library" //with "Resources" is so that when saving, I can change it back to the original //(like how unity_builtin_extra goes back to "resources", not "library") if (assetPath == "resources/unity_builtin_extra") { assetPath = "Resources/unity_builtin_extra"; } else if (assetPath == "library/unity default resources" || assetPath == "Library/unity default resources") { assetPath = "Resources/unity default resources"; } else if (assetPath == "library/unity editor resources" || assetPath == "Library/unity editor resources") { assetPath = "Resources/unity editor resources"; } }
public ulong Read(ulong absFilePos, AssetsFileReader reader, bool bigEndian) { guid = new GUID128(); guid.Read(reader.Position, reader); bufferedPath = new byte[] { reader.ReadByte() }; //todo: why type = reader.ReadInt32(); assetPath = reader.ReadNullTerminated(); if (assetPath.StartsWith("library/")) { assetPath = "Resources\\" + assetPath.Substring(8); } return(reader.Position); }
public string assetPath; //path to the .assets file public void Read(AssetsFileReader reader) { bufferedPath = reader.ReadNullTerminated(); guid = new GUID128(); guid.Read(reader); type = reader.ReadInt32(); assetPath = reader.ReadNullTerminated(); //todo: the switchero was here for testing purposes, should be handled by application for full control if (assetPath.StartsWith("library/")) { assetPath = "Resources/" + assetPath.Substring(8); } }
public byte[] bufferedPath; //for buffered (type=1) public ulong Read(ulong absFilePos, AssetsFileReader reader, bool bigEndian) { bufferedPath = new byte[] { reader.ReadByte() }; //-Dunno why it's here but it is guid = new GUID128(); guid.Read(reader.Position, reader); type = reader.ReadInt32(); assetPath = reader.ReadNullTerminated(); //todo: the switchero was here for testing purposes, should be handled by application for full control if (assetPath.StartsWith("library/")) { assetPath = "Resources\\" + assetPath.Substring(8); } return(reader.Position); }