mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-27 22:00:23 -04:00
support use asset original name when display and export
This commit is contained in:
parent
bd18bfb8ea
commit
f8e7303169
12
Unity Studio/Properties/Settings.Designer.cs
generated
12
Unity Studio/Properties/Settings.Designer.cs
generated
@ -226,5 +226,17 @@ namespace Unity_Studio.Properties {
|
|||||||
this["convertType"] = value;
|
this["convertType"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||||
|
public bool displayOriginalName {
|
||||||
|
get {
|
||||||
|
return ((bool)(this["displayOriginalName"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["displayOriginalName"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,5 +53,8 @@
|
|||||||
<Setting Name="convertType" Type="System.String" Scope="User">
|
<Setting Name="convertType" Type="System.String" Scope="User">
|
||||||
<Value Profile="(Default)">PNG</Value>
|
<Value Profile="(Default)">PNG</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<Setting Name="displayOriginalName" Type="System.Boolean" Scope="User">
|
||||||
|
<Value Profile="(Default)">False</Value>
|
||||||
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
52
Unity Studio/Unity Classes/AssetBundle.cs
Normal file
52
Unity Studio/Unity Classes/AssetBundle.cs
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Unity_Studio
|
||||||
|
{
|
||||||
|
|
||||||
|
class AssetBundle
|
||||||
|
{
|
||||||
|
public class AssetInfo
|
||||||
|
{
|
||||||
|
public int preloadIndex;
|
||||||
|
public int preloadSize;
|
||||||
|
public PPtr asset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ContainerData
|
||||||
|
{
|
||||||
|
public string first;
|
||||||
|
public AssetInfo second;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<ContainerData> m_Container = new List<ContainerData>();
|
||||||
|
|
||||||
|
public AssetBundle(AssetPreloadData preloadData)
|
||||||
|
{
|
||||||
|
var sourceFile = preloadData.sourceFile;
|
||||||
|
var a_Stream = preloadData.sourceFile.a_Stream;
|
||||||
|
a_Stream.Position = preloadData.Offset;
|
||||||
|
|
||||||
|
var m_Name = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
|
||||||
|
var size = a_Stream.ReadInt32();
|
||||||
|
for (int i = 0; i < size; i++)
|
||||||
|
{
|
||||||
|
sourceFile.ReadPPtr();
|
||||||
|
}
|
||||||
|
size = a_Stream.ReadInt32();
|
||||||
|
for (int i = 0; i < size; i++)
|
||||||
|
{
|
||||||
|
var temp = new ContainerData();
|
||||||
|
temp.first = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
|
||||||
|
temp.second = new AssetInfo();
|
||||||
|
temp.second.preloadIndex = a_Stream.ReadInt32();
|
||||||
|
temp.second.preloadSize = a_Stream.ReadInt32();
|
||||||
|
temp.second.asset = sourceFile.ReadPPtr();
|
||||||
|
m_Container.Add(temp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -240,7 +240,7 @@ namespace Unity_Studio
|
|||||||
return extractedCount;
|
return extractedCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void BuildAssetStructures(bool loadAssetsMenuItem, bool displayAll, bool buildHierarchyMenuItem, bool buildClassStructuresMenuItem)
|
public static void BuildAssetStructures(bool loadAssetsMenuItem, bool displayAll, bool buildHierarchyMenuItem, bool buildClassStructuresMenuItem, bool displayOriginalName)
|
||||||
{
|
{
|
||||||
#region first loop - read asset data & create list
|
#region first loop - read asset data & create list
|
||||||
if (loadAssetsMenuItem)
|
if (loadAssetsMenuItem)
|
||||||
@ -255,7 +255,7 @@ namespace Unity_Studio
|
|||||||
StatusStripUpdate("Building asset list from " + Path.GetFileName(assetsFile.filePath));
|
StatusStripUpdate("Building asset list from " + Path.GetFileName(assetsFile.filePath));
|
||||||
|
|
||||||
string fileID = i.ToString(fileIDfmt);
|
string fileID = i.ToString(fileIDfmt);
|
||||||
|
AssetBundle ab = null;
|
||||||
foreach (var asset in assetsFile.preloadTable.Values)
|
foreach (var asset in assetsFile.preloadTable.Values)
|
||||||
{
|
{
|
||||||
asset.uniqueID = fileID + asset.uniqueID;
|
asset.uniqueID = fileID + asset.uniqueID;
|
||||||
@ -330,6 +330,11 @@ namespace Unity_Studio
|
|||||||
exportable = true;
|
exportable = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 142: //AssetBundle
|
||||||
|
{
|
||||||
|
ab = new AssetBundle(asset);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 21: //Material
|
case 21: //Material
|
||||||
case 74: //AnimationClip
|
case 74: //AnimationClip
|
||||||
case 90: //Avatar
|
case 90: //Avatar
|
||||||
@ -370,6 +375,15 @@ namespace Unity_Studio
|
|||||||
}
|
}
|
||||||
ProgressBarPerformStep();
|
ProgressBarPerformStep();
|
||||||
}
|
}
|
||||||
|
if (displayOriginalName)
|
||||||
|
{
|
||||||
|
assetsFile.exportableAssets.ForEach(x =>
|
||||||
|
{
|
||||||
|
var replacename = ab?.m_Container.Find(y => y.second.asset.m_PathID == x.m_PathID)?.first;
|
||||||
|
if (!string.IsNullOrEmpty(replacename))
|
||||||
|
x.Text = replacename.Replace(Path.GetExtension(replacename), "");
|
||||||
|
});
|
||||||
|
}
|
||||||
exportableAssets.AddRange(assetsFile.exportableAssets);
|
exportableAssets.AddRange(assetsFile.exportableAssets);
|
||||||
//if (assetGroup.Items.Count > 0) { listView1.Groups.Add(assetGroup); }
|
//if (assetGroup.Items.Count > 0) { listView1.Groups.Add(assetGroup); }
|
||||||
}
|
}
|
||||||
|
@ -159,6 +159,7 @@
|
|||||||
<Compile Include="AboutBox.Designer.cs">
|
<Compile Include="AboutBox.Designer.cs">
|
||||||
<DependentUpon>AboutBox.cs</DependentUpon>
|
<DependentUpon>AboutBox.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Unity Classes\AssetBundle.cs" />
|
||||||
<Compile Include="Unity Studio Classes\AssetPreloadData.cs" />
|
<Compile Include="Unity Studio Classes\AssetPreloadData.cs" />
|
||||||
<Compile Include="Unity Classes\AudioClip.cs" />
|
<Compile Include="Unity Classes\AudioClip.cs" />
|
||||||
<Compile Include="Unity Classes\BuildSettings.cs" />
|
<Compile Include="Unity Classes\BuildSettings.cs" />
|
||||||
|
14
Unity Studio/UnityStudioForm.Designer.cs
generated
14
Unity Studio/UnityStudioForm.Designer.cs
generated
@ -45,6 +45,7 @@
|
|||||||
this.exportClassStructuresMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.exportClassStructuresMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.displayAll = new System.Windows.Forms.ToolStripMenuItem();
|
this.displayAll = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.displayOriginalName = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.enablePreview = new System.Windows.Forms.ToolStripMenuItem();
|
this.enablePreview = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.displayInfo = new System.Windows.Forms.ToolStripMenuItem();
|
this.displayInfo = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.openAfterExport = new System.Windows.Forms.ToolStripMenuItem();
|
this.openAfterExport = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
@ -233,6 +234,7 @@
|
|||||||
//
|
//
|
||||||
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.displayAll,
|
this.displayAll,
|
||||||
|
this.displayOriginalName,
|
||||||
this.enablePreview,
|
this.enablePreview,
|
||||||
this.displayInfo,
|
this.displayInfo,
|
||||||
this.openAfterExport,
|
this.openAfterExport,
|
||||||
@ -242,6 +244,15 @@
|
|||||||
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
|
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
|
||||||
this.optionsToolStripMenuItem.Text = "Options";
|
this.optionsToolStripMenuItem.Text = "Options";
|
||||||
//
|
//
|
||||||
|
// displayOriginalName
|
||||||
|
//
|
||||||
|
this.displayOriginalName.CheckOnClick = true;
|
||||||
|
this.displayOriginalName.Name = "displayOriginalName";
|
||||||
|
this.displayOriginalName.Size = new System.Drawing.Size(252, 22);
|
||||||
|
this.displayOriginalName.Text = "Display asset original name";
|
||||||
|
this.displayOriginalName.ToolTipText = "Check this option will use asset original name when display and export";
|
||||||
|
this.displayOriginalName.CheckedChanged += new System.EventHandler(this.MenuItem_CheckedChanged);
|
||||||
|
//
|
||||||
// displayAll
|
// displayAll
|
||||||
//
|
//
|
||||||
this.displayAll.CheckOnClick = true;
|
this.displayAll.CheckOnClick = true;
|
||||||
@ -808,7 +819,7 @@
|
|||||||
//
|
//
|
||||||
// timerOpenTK
|
// timerOpenTK
|
||||||
//
|
//
|
||||||
this.timerOpenTK.Interval = 1000/6;
|
this.timerOpenTK.Interval = 1000 / 6;
|
||||||
this.timerOpenTK.Tick += new System.EventHandler(this.timerOpenTK_Tick);
|
this.timerOpenTK.Tick += new System.EventHandler(this.timerOpenTK_Tick);
|
||||||
//
|
//
|
||||||
// openFileDialog1
|
// openFileDialog1
|
||||||
@ -929,6 +940,7 @@
|
|||||||
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem displayAll;
|
private System.Windows.Forms.ToolStripMenuItem displayAll;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem displayOriginalName;
|
||||||
private System.Windows.Forms.ToolStripMenuItem enablePreview;
|
private System.Windows.Forms.ToolStripMenuItem enablePreview;
|
||||||
private System.Windows.Forms.ToolStripMenuItem displayInfo;
|
private System.Windows.Forms.ToolStripMenuItem displayInfo;
|
||||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
|
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
|
||||||
|
@ -269,7 +269,7 @@ namespace Unity_Studio
|
|||||||
bool optionBuildHierarchyMenuItem = !dontBuildHierarchyMenuItem.Checked;
|
bool optionBuildHierarchyMenuItem = !dontBuildHierarchyMenuItem.Checked;
|
||||||
bool optionBuildClassStructuresMenuItem = buildClassStructuresMenuItem.Checked;
|
bool optionBuildClassStructuresMenuItem = buildClassStructuresMenuItem.Checked;
|
||||||
|
|
||||||
BuildAssetStructures(optionLoadAssetsMenuItem, optionDisplayAll, optionBuildHierarchyMenuItem, optionBuildClassStructuresMenuItem);
|
BuildAssetStructures(optionLoadAssetsMenuItem, optionDisplayAll, optionBuildHierarchyMenuItem, optionBuildClassStructuresMenuItem, displayOriginalName.Checked);
|
||||||
|
|
||||||
BeginInvoke(new Action(() =>
|
BeginInvoke(new Action(() =>
|
||||||
{
|
{
|
||||||
@ -1069,7 +1069,7 @@ namespace Unity_Studio
|
|||||||
textPreviewBox.Visible = true;
|
textPreviewBox.Visible = true;
|
||||||
}
|
}
|
||||||
else*/
|
else*/
|
||||||
StatusStripUpdate("Only supported export the raw file.");
|
StatusStripUpdate("Only supported export the raw file.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1682,6 +1682,7 @@ namespace Unity_Studio
|
|||||||
{
|
{
|
||||||
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
|
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
displayOriginalName.Checked = (bool)Properties.Settings.Default["displayOriginalName"];
|
||||||
displayAll.Checked = (bool)Properties.Settings.Default["displayAll"];
|
displayAll.Checked = (bool)Properties.Settings.Default["displayAll"];
|
||||||
displayInfo.Checked = (bool)Properties.Settings.Default["displayInfo"];
|
displayInfo.Checked = (bool)Properties.Settings.Default["displayInfo"];
|
||||||
enablePreview.Checked = (bool)Properties.Settings.Default["enablePreview"];
|
enablePreview.Checked = (bool)Properties.Settings.Default["enablePreview"];
|
||||||
|
@ -58,6 +58,9 @@
|
|||||||
<setting name="convertType" serializeAs="String">
|
<setting name="convertType" serializeAs="String">
|
||||||
<value>PNG</value>
|
<value>PNG</value>
|
||||||
</setting>
|
</setting>
|
||||||
|
<setting name="displayOriginalName" serializeAs="String">
|
||||||
|
<value>False</value>
|
||||||
|
</setting>
|
||||||
</Unity_Studio.Properties.Settings>
|
</Unity_Studio.Properties.Settings>
|
||||||
</userSettings>
|
</userSettings>
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
|
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
|
||||||
|
Loading…
Reference in New Issue
Block a user