This commit is contained in:
Perfare 2018-03-29 01:29:51 +08:00
parent e5104d5cc7
commit 140a732046
4 changed files with 8 additions and 8 deletions

View File

@ -469,8 +469,10 @@ namespace UnityStudio
bool m_KeepIndices = reader.ReadBoolean(); bool m_KeepIndices = reader.ReadBoolean();
} }
reader.AlignStream(4); reader.AlignStream(4);
//This is a Unity bug fixed in 2017.3.1p1 and later versions
if ((version[0] > 2017 || (version[0] == 2017 && version[1] >= 4)) || //2017.4 if ((version[0] > 2017 || (version[0] == 2017 && version[1] >= 4)) || //2017.4
((version[0] == 2017 && version[1] == 3) && m_MeshCompression == 0))//2017.3 ((version[0] == 2017 && version[1] == 3 && version[2] == 1) && MeshPD.sourceFile.buildType[0] == "p") || //fixed after 2017.3.1px
((version[0] == 2017 && version[1] == 3) && m_MeshCompression == 0))//2017.3.xfx with no compression
{ {
var m_IndexFormat = reader.ReadInt32(); var m_IndexFormat = reader.ReadInt32();
} }

View File

@ -34,7 +34,6 @@ namespace UnityStudio
private bool baseDefinitions; private bool baseDefinitions;
private List<int[]> classIDs = new List<int[]>();//use for 5.5.0 private List<int[]> classIDs = new List<int[]>();//use for 5.5.0
public static string[] buildTypeSplit = { ".", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
#region cmmon string #region cmmon string
private static Dictionary<int, string> baseStrings = new Dictionary<int, string> private static Dictionary<int, string> baseStrings = new Dictionary<int, string>
@ -324,9 +323,8 @@ namespace UnityStudio
} }
#endregion #endregion
buildType = m_Version.Split(buildTypeSplit, StringSplitOptions.RemoveEmptyEntries); buildType = Regex.Replace(m_Version, @"\d", "").Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries);
var strver = from Match m in Regex.Matches(m_Version, @"[0-9]") select m.Value; version = Regex.Matches(m_Version, @"\d").Cast<Match>().Select(m => int.Parse(m.Value)).ToArray();
version = Array.ConvertAll(strver.ToArray(), int.Parse);
if (version[0] == 2 && version[1] == 0 && version[2] == 1 && version[3] == 7)//2017.x if (version[0] == 2 && version[1] == 0 && version[2] == 1 && version[3] == 7)//2017.x
{ {
var nversion = new int[version.Length - 3]; var nversion = new int[version.Length - 3];

View File

@ -116,8 +116,8 @@ namespace UnityStudio
{ {
//make use of the bundle file version //make use of the bundle file version
assetsFile.m_Version = bundleFile.versionEngine; assetsFile.m_Version = bundleFile.versionEngine;
assetsFile.version = Array.ConvertAll((from Match m in Regex.Matches(assetsFile.m_Version, @"[0-9]") select m.Value).ToArray(), int.Parse); assetsFile.version = Regex.Matches(bundleFile.versionEngine, @"\d").Cast<Match>().Select(m => int.Parse(m.Value)).ToArray();
assetsFile.buildType = bundleFile.versionEngine.Split(AssetsFile.buildTypeSplit, StringSplitOptions.RemoveEmptyEntries); assetsFile.buildType = Regex.Replace(bundleFile.versionEngine, @"\d", "").Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries);
} }
assetsfileList.Add(assetsFile); assetsfileList.Add(assetsFile);

View File

@ -1435,7 +1435,7 @@ namespace UnityStudio
break; break;
case "exportSelectedAssetsMenuItem": case "exportSelectedAssetsMenuItem":
toExportAssets = new List<AssetPreloadData>(assetListView.SelectedIndices.Count); toExportAssets = new List<AssetPreloadData>(assetListView.SelectedIndices.Count);
foreach (var i in assetListView.SelectedIndices.OfType<int>()) foreach (int i in assetListView.SelectedIndices)
{ {
toExportAssets.Add((AssetPreloadData)assetListView.Items[i]); toExportAssets.Add((AssetPreloadData)assetListView.Items[i]);
} }