mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-27 22:00:23 -04:00
support Unity 2017.1.0
fixed show "bundle file" original file
This commit is contained in:
parent
9687f823fb
commit
14ec7c8259
@ -40,20 +40,21 @@ namespace Unity_Studio
|
||||
m_ShaderKeywords[i] = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
|
||||
}
|
||||
}
|
||||
else if (sourceFile.version[0] == 5)
|
||||
else if (sourceFile.version[0] >= 5)//5.0 and up
|
||||
{
|
||||
m_ShaderKeywords = new string[1] { a_Stream.ReadAlignedString(a_Stream.ReadInt32()) };
|
||||
uint m_LightmapFlags = a_Stream.ReadUInt32();
|
||||
if ((sourceFile.version[0] == 5 && sourceFile.version[1] >= 6) || sourceFile.version[0] > 5)//5.6.0 and up
|
||||
if (sourceFile.version[0] == 5 && sourceFile.version[1] >= 6 || sourceFile.version[0] > 5)//5.6.0 and up
|
||||
{
|
||||
var m_EnableInstancingVariants = a_Stream.ReadBoolean();
|
||||
//var m_DoubleSidedGI = a_Stream.ReadBoolean();//2017.x
|
||||
a_Stream.AlignStream(4);
|
||||
}
|
||||
}
|
||||
|
||||
if (sourceFile.version[0] > 4 || (sourceFile.version[0] == 4 && sourceFile.version[1] >= 3)) { m_CustomRenderQueue = a_Stream.ReadInt32(); }
|
||||
if (sourceFile.version[0] > 4 || sourceFile.version[0] == 4 && sourceFile.version[1] >= 3) { m_CustomRenderQueue = a_Stream.ReadInt32(); }
|
||||
|
||||
if (sourceFile.version[0] == 5 && sourceFile.version[1] >= 1)
|
||||
if (sourceFile.version[0] == 5 && sourceFile.version[1] >= 1 || sourceFile.version[0] > 5)//5.1 and up
|
||||
{
|
||||
string[][] stringTagMap = new string[a_Stream.ReadInt32()][];
|
||||
for (int i = 0; i < stringTagMap.Length; i++)
|
||||
|
@ -136,7 +136,11 @@ namespace Unity_Studio
|
||||
m_Aniso = a_Stream.ReadInt32();
|
||||
m_MipBias = a_Stream.ReadSingle();
|
||||
m_WrapMode = a_Stream.ReadInt32();
|
||||
|
||||
if (sourceFile.version[0] == 2017)//2017.x
|
||||
{
|
||||
int m_WrapV = a_Stream.ReadInt32();
|
||||
int m_WrapW = a_Stream.ReadInt32();
|
||||
}
|
||||
if (sourceFile.version[0] >= 3)
|
||||
{
|
||||
m_LightmapFormat = a_Stream.ReadInt32();
|
||||
|
@ -11,6 +11,7 @@ namespace Unity_Studio
|
||||
{
|
||||
public EndianStream a_Stream;
|
||||
public string filePath;
|
||||
public string bundlePath;
|
||||
public string fileName;
|
||||
public int fileGen;
|
||||
public bool valid;
|
||||
@ -381,7 +382,13 @@ namespace Unity_Studio
|
||||
buildType = m_Version.Split(buildTypeSplit, StringSplitOptions.RemoveEmptyEntries);
|
||||
var strver = from Match m in Regex.Matches(m_Version, @"[0-9]") select m.Value;
|
||||
version = Array.ConvertAll(strver.ToArray(), int.Parse);
|
||||
|
||||
if (version[0] == 2 && version[1] == 0 && version[2] == 1 && version[3] == 7)//2017.x
|
||||
{
|
||||
var nversion = new int[version.Length - 3];
|
||||
nversion[0] = 2017;
|
||||
Array.Copy(version, 4, nversion, 1, version.Length - 4);
|
||||
version = nversion;
|
||||
}
|
||||
if (fileGen >= 14)
|
||||
{
|
||||
//this looks like a list of assets that need to be preloaded in memory before anytihng else
|
||||
|
@ -136,6 +136,7 @@ namespace Unity_Studio
|
||||
AssetsFile assetsFile = new AssetsFile(memFile.fileName, new EndianStream(memFile.memStream, EndianType.BigEndian));
|
||||
if (assetsFile.valid)
|
||||
{
|
||||
assetsFile.bundlePath = bundleFileName;
|
||||
if (assetsFile.fileGen == 6 && Path.GetFileName(bundleFileName) != "mainData") //2.6.x and earlier don't have a string version before the preload table
|
||||
{
|
||||
//make use of the bundle file version
|
||||
|
@ -1861,7 +1861,7 @@ namespace Unity_Studio
|
||||
|
||||
private void showOriginalFileToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
var args = $"/select, {selectasset.sourceFile.filePath}";
|
||||
var args = $"/select, {selectasset.sourceFile.bundlePath ?? selectasset.sourceFile.filePath}";
|
||||
var pfi = new ProcessStartInfo("explorer.exe", args);
|
||||
Process.Start(pfi);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user