Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c94852939 | |||
| 5ba447aba2 | |||
| cdfcba78a9 |
@@ -105,6 +105,10 @@ namespace Unity_Studio
|
|||||||
extension = ".fsb";
|
extension = ".fsb";
|
||||||
preloadData.InfoText += "FSB";
|
preloadData.InfoText += "FSB";
|
||||||
break;
|
break;
|
||||||
|
case 2://FSB5
|
||||||
|
extension = ".fsb";
|
||||||
|
preloadData.InfoText += "FSB";
|
||||||
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
extension = ".mp3";
|
extension = ".mp3";
|
||||||
preloadData.InfoText += "MP3";
|
preloadData.InfoText += "MP3";
|
||||||
|
|||||||
@@ -163,21 +163,24 @@ namespace Unity_Studio
|
|||||||
|
|
||||||
public string ReadAlignedString(int length)
|
public string ReadAlignedString(int length)
|
||||||
{
|
{
|
||||||
|
if (length > 0 && length < (base.BaseStream.Length - base.BaseStream.Position))//crude failsafe
|
||||||
byte[] stringData = new byte[length];
|
|
||||||
base.Read(stringData, 0, length);
|
|
||||||
var result = System.Text.Encoding.UTF8.GetString(stringData); //must verify strange characters in PS3
|
|
||||||
|
|
||||||
/*string result = "";
|
|
||||||
char c;
|
|
||||||
for (int i = 0; i < length; i++)
|
|
||||||
{
|
{
|
||||||
c = (char)base.ReadByte();
|
byte[] stringData = new byte[length];
|
||||||
result += c.ToString();
|
base.Read(stringData, 0, length);
|
||||||
}*/
|
var result = System.Text.Encoding.UTF8.GetString(stringData); //must verify strange characters in PS3
|
||||||
|
|
||||||
AlignStream(4);
|
/*string result = "";
|
||||||
return result;
|
char c;
|
||||||
|
for (int i = 0; i < length; i++)
|
||||||
|
{
|
||||||
|
c = (char)base.ReadByte();
|
||||||
|
result += c.ToString();
|
||||||
|
}*/
|
||||||
|
|
||||||
|
AlignStream(4);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
else { return ""; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ReadStringToNull()
|
public string ReadStringToNull()
|
||||||
|
|||||||
@@ -81,11 +81,11 @@ So Unity adds a -90 degree rotation, similar to the FBX PreRotation, to bring th
|
|||||||
Except it does it as a regular rotation, and combines it with any other rotations in the Transform asset.
|
Except it does it as a regular rotation, and combines it with any other rotations in the Transform asset.
|
||||||
|
|
||||||
Converting from Unity back to FBX, the same vertex conversion cannot be applied because we have to take into account the rotation.
|
Converting from Unity back to FBX, the same vertex conversion cannot be applied because we have to take into account the rotation.
|
||||||
Option 0: convert vertices and transformations as -X,Y,Z and set FBX option to Y-up without PreRotation!
|
Option 0: export vertices and transformations as -X,Y,Z and set FBX option to Y-up without PreRotation!
|
||||||
the result will be Max Z = FBX Y, Max -Y = FBX Z, Max X = FBX X => final order -X -Z Y
|
the result will be Max Z = FBX Y, Max -Y = FBX Z, Max X = FBX X => final order -X -Z Y
|
||||||
Option 1: convert vertices and transformations as -X,-Z,Y and set FBX options as "Z-up".
|
Option 1: export vertices and transformations as -X,-Z,Y and set FBX options as "Z-up".
|
||||||
The -90 rotation exported from Unity will bring the model in correct orientation.
|
The -90 rotation exported from Unity will bring the model in correct orientation.
|
||||||
Option 2: convert vertices and transformations as -X,-Y,-Z, add -90 PreRotation to every Mesh Node and set FBX options as "Y-up".
|
Option 2: export vertices and transformations as -X,-Y,-Z, add -90 PreRotation to every Mesh Node and set FBX options as "Y-up".
|
||||||
The -90 rotation from Unity plus the -90 PreRotation will bring the model in correct orientation.
|
The -90 rotation from Unity plus the -90 PreRotation will bring the model in correct orientation.
|
||||||
Remember though that the PreRotation is baked into the Geometry.
|
Remember though that the PreRotation is baked into the Geometry.
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace Unity_Studio
|
|||||||
else if (sourceFile.version[0] == 3 && sourceFile.version[1] <= 4) { }
|
else if (sourceFile.version[0] == 3 && sourceFile.version[1] <= 4) { }
|
||||||
else { int accelerometerFrequency = a_Stream.ReadInt32(); }//3.5.0 and up
|
else { int accelerometerFrequency = a_Stream.ReadInt32(); }//3.5.0 and up
|
||||||
}
|
}
|
||||||
|
//fail in Unity 5 beta
|
||||||
companyName = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
|
companyName = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
|
||||||
productName = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
|
productName = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+27
-14
@@ -62,7 +62,6 @@
|
|||||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||||
this.tabControl1 = new System.Windows.Forms.TabControl();
|
this.tabControl1 = new System.Windows.Forms.TabControl();
|
||||||
this.tabPage1 = new System.Windows.Forms.TabPage();
|
this.tabPage1 = new System.Windows.Forms.TabPage();
|
||||||
this.sceneTreeView = new Unity_Studio.GOHierarchy();
|
|
||||||
this.treeSearch = new System.Windows.Forms.TextBox();
|
this.treeSearch = new System.Windows.Forms.TextBox();
|
||||||
this.tabPage2 = new System.Windows.Forms.TabPage();
|
this.tabPage2 = new System.Windows.Forms.TabPage();
|
||||||
this.assetListView = new System.Windows.Forms.ListView();
|
this.assetListView = new System.Windows.Forms.ListView();
|
||||||
@@ -75,6 +74,7 @@
|
|||||||
this.previewPanel = new System.Windows.Forms.Panel();
|
this.previewPanel = new System.Windows.Forms.Panel();
|
||||||
this.assetInfoLabel = new System.Windows.Forms.Label();
|
this.assetInfoLabel = new System.Windows.Forms.Label();
|
||||||
this.FMODpanel = new System.Windows.Forms.Panel();
|
this.FMODpanel = new System.Windows.Forms.Panel();
|
||||||
|
this.FMODcopyright = new System.Windows.Forms.Label();
|
||||||
this.FMODinfoLabel = new System.Windows.Forms.Label();
|
this.FMODinfoLabel = new System.Windows.Forms.Label();
|
||||||
this.FMODtimerLabel = new System.Windows.Forms.Label();
|
this.FMODtimerLabel = new System.Windows.Forms.Label();
|
||||||
this.FMODstatusLabel = new System.Windows.Forms.Label();
|
this.FMODstatusLabel = new System.Windows.Forms.Label();
|
||||||
@@ -100,6 +100,7 @@
|
|||||||
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
|
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
|
||||||
this.saveFolderDialog1 = new System.Windows.Forms.SaveFileDialog();
|
this.saveFolderDialog1 = new System.Windows.Forms.SaveFileDialog();
|
||||||
this.treeTip = new System.Windows.Forms.ToolTip(this.components);
|
this.treeTip = new System.Windows.Forms.ToolTip(this.components);
|
||||||
|
this.sceneTreeView = new Unity_Studio.GOHierarchy();
|
||||||
this.menuStrip1.SuspendLayout();
|
this.menuStrip1.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||||
this.splitContainer1.Panel1.SuspendLayout();
|
this.splitContainer1.Panel1.SuspendLayout();
|
||||||
@@ -390,8 +391,6 @@
|
|||||||
this.splitContainer1.SplitterDistance = 420;
|
this.splitContainer1.SplitterDistance = 420;
|
||||||
this.splitContainer1.TabIndex = 2;
|
this.splitContainer1.TabIndex = 2;
|
||||||
this.splitContainer1.TabStop = false;
|
this.splitContainer1.TabStop = false;
|
||||||
this.splitContainer1.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(this.splitContainer1_SplitterMoved);
|
|
||||||
this.splitContainer1.Resize += new System.EventHandler(this.splitContainer1_Resize);
|
|
||||||
//
|
//
|
||||||
// tabControl1
|
// tabControl1
|
||||||
//
|
//
|
||||||
@@ -418,17 +417,6 @@
|
|||||||
this.tabPage1.Text = "Scene Hierarchy";
|
this.tabPage1.Text = "Scene Hierarchy";
|
||||||
this.tabPage1.UseVisualStyleBackColor = true;
|
this.tabPage1.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// sceneTreeView
|
|
||||||
//
|
|
||||||
this.sceneTreeView.CheckBoxes = true;
|
|
||||||
this.sceneTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
|
|
||||||
this.sceneTreeView.HideSelection = false;
|
|
||||||
this.sceneTreeView.Location = new System.Drawing.Point(0, 20);
|
|
||||||
this.sceneTreeView.Name = "sceneTreeView";
|
|
||||||
this.sceneTreeView.Size = new System.Drawing.Size(410, 588);
|
|
||||||
this.sceneTreeView.TabIndex = 1;
|
|
||||||
this.sceneTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.sceneTreeView_AfterCheck);
|
|
||||||
//
|
|
||||||
// treeSearch
|
// treeSearch
|
||||||
//
|
//
|
||||||
this.treeSearch.Dock = System.Windows.Forms.DockStyle.Top;
|
this.treeSearch.Dock = System.Windows.Forms.DockStyle.Top;
|
||||||
@@ -454,6 +442,7 @@
|
|||||||
this.tabPage2.TabIndex = 1;
|
this.tabPage2.TabIndex = 1;
|
||||||
this.tabPage2.Text = "Asset List";
|
this.tabPage2.Text = "Asset List";
|
||||||
this.tabPage2.UseVisualStyleBackColor = true;
|
this.tabPage2.UseVisualStyleBackColor = true;
|
||||||
|
this.tabPage2.Resize += new System.EventHandler(this.tabPage2_Resize);
|
||||||
//
|
//
|
||||||
// assetListView
|
// assetListView
|
||||||
//
|
//
|
||||||
@@ -490,6 +479,7 @@
|
|||||||
// columnHeaderSize
|
// columnHeaderSize
|
||||||
//
|
//
|
||||||
this.columnHeaderSize.Text = "Size";
|
this.columnHeaderSize.Text = "Size";
|
||||||
|
this.columnHeaderSize.Width = 23;
|
||||||
//
|
//
|
||||||
// listSearch
|
// listSearch
|
||||||
//
|
//
|
||||||
@@ -552,6 +542,7 @@
|
|||||||
//
|
//
|
||||||
this.FMODpanel.Anchor = System.Windows.Forms.AnchorStyles.None;
|
this.FMODpanel.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||||
this.FMODpanel.BackColor = System.Drawing.SystemColors.ControlDark;
|
this.FMODpanel.BackColor = System.Drawing.SystemColors.ControlDark;
|
||||||
|
this.FMODpanel.Controls.Add(this.FMODcopyright);
|
||||||
this.FMODpanel.Controls.Add(this.FMODinfoLabel);
|
this.FMODpanel.Controls.Add(this.FMODinfoLabel);
|
||||||
this.FMODpanel.Controls.Add(this.FMODtimerLabel);
|
this.FMODpanel.Controls.Add(this.FMODtimerLabel);
|
||||||
this.FMODpanel.Controls.Add(this.FMODstatusLabel);
|
this.FMODpanel.Controls.Add(this.FMODstatusLabel);
|
||||||
@@ -567,6 +558,16 @@
|
|||||||
this.FMODpanel.TabIndex = 2;
|
this.FMODpanel.TabIndex = 2;
|
||||||
this.FMODpanel.Visible = false;
|
this.FMODpanel.Visible = false;
|
||||||
//
|
//
|
||||||
|
// FMODcopyright
|
||||||
|
//
|
||||||
|
this.FMODcopyright.AutoSize = true;
|
||||||
|
this.FMODcopyright.ForeColor = System.Drawing.SystemColors.ControlLight;
|
||||||
|
this.FMODcopyright.Location = new System.Drawing.Point(117, 187);
|
||||||
|
this.FMODcopyright.Name = "FMODcopyright";
|
||||||
|
this.FMODcopyright.Size = new System.Drawing.Size(283, 13);
|
||||||
|
this.FMODcopyright.TabIndex = 9;
|
||||||
|
this.FMODcopyright.Text = "Audio Engine supplied by FMOD by Firelight Technologies.";
|
||||||
|
//
|
||||||
// FMODinfoLabel
|
// FMODinfoLabel
|
||||||
//
|
//
|
||||||
this.FMODinfoLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
this.FMODinfoLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||||
@@ -801,6 +802,17 @@
|
|||||||
this.saveFolderDialog1.RestoreDirectory = true;
|
this.saveFolderDialog1.RestoreDirectory = true;
|
||||||
this.saveFolderDialog1.Title = "Browse for folder";
|
this.saveFolderDialog1.Title = "Browse for folder";
|
||||||
//
|
//
|
||||||
|
// sceneTreeView
|
||||||
|
//
|
||||||
|
this.sceneTreeView.CheckBoxes = true;
|
||||||
|
this.sceneTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
|
this.sceneTreeView.HideSelection = false;
|
||||||
|
this.sceneTreeView.Location = new System.Drawing.Point(0, 20);
|
||||||
|
this.sceneTreeView.Name = "sceneTreeView";
|
||||||
|
this.sceneTreeView.Size = new System.Drawing.Size(410, 588);
|
||||||
|
this.sceneTreeView.TabIndex = 1;
|
||||||
|
this.sceneTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.sceneTreeView_AfterCheck);
|
||||||
|
//
|
||||||
// UnityStudioForm
|
// UnityStudioForm
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
@@ -917,6 +929,7 @@
|
|||||||
private System.Windows.Forms.TextBox classTextBox;
|
private System.Windows.Forms.TextBox classTextBox;
|
||||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
|
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
|
||||||
private System.Windows.Forms.ToolStripMenuItem exportClassStructuresMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem exportClassStructuresMenuItem;
|
||||||
|
private System.Windows.Forms.Label FMODcopyright;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+123
-92
@@ -14,10 +14,9 @@ using Tao.DevIl;
|
|||||||
using System.Web.Script.Serialization;
|
using System.Web.Script.Serialization;
|
||||||
|
|
||||||
|
|
||||||
//Load parent nodes even if they are not selected to provide transformations?
|
/*TODO
|
||||||
//For extracting bundles, first check if file exists then decompress
|
Load parent nodes even if they are not selected to provide transformations?
|
||||||
|
For extracting bundles, first check if file exists then decompress*/
|
||||||
//rigurous search for search files; look into Path.Combine
|
|
||||||
|
|
||||||
namespace Unity_Studio
|
namespace Unity_Studio
|
||||||
{
|
{
|
||||||
@@ -25,8 +24,8 @@ namespace Unity_Studio
|
|||||||
{
|
{
|
||||||
private List<string> unityFiles = new List<string>(); //files to load
|
private List<string> unityFiles = new List<string>(); //files to load
|
||||||
public static List<AssetsFile> assetsfileList = new List<AssetsFile>(); //loaded files
|
public static List<AssetsFile> assetsfileList = new List<AssetsFile>(); //loaded files
|
||||||
private List<AssetPreloadData> exportableAssets = new List<AssetPreloadData>(); //used to hold all listItems while the list is being filtered
|
private List<AssetPreloadData> exportableAssets = new List<AssetPreloadData>(); //used to hold all assets while the ListView is filtered
|
||||||
private List<AssetPreloadData> visibleAssets = new List<AssetPreloadData>(); //used to build the listView
|
private List<AssetPreloadData> visibleAssets = new List<AssetPreloadData>(); //used to build the ListView from all or filtered assets
|
||||||
private AssetPreloadData lastSelectedItem = null;
|
private AssetPreloadData lastSelectedItem = null;
|
||||||
private AssetPreloadData lastLoadedAsset = null;
|
private AssetPreloadData lastLoadedAsset = null;
|
||||||
//private AssetsFile mainDataFile = null;
|
//private AssetsFile mainDataFile = null;
|
||||||
@@ -40,7 +39,6 @@ namespace Unity_Studio
|
|||||||
private FMOD.Sound sound = null;
|
private FMOD.Sound sound = null;
|
||||||
private FMOD.Channel channel = null;
|
private FMOD.Channel channel = null;
|
||||||
private FMOD.SoundGroup masterSoundGroup = null;
|
private FMOD.SoundGroup masterSoundGroup = null;
|
||||||
|
|
||||||
private FMOD.MODE loopMode = FMOD.MODE.LOOP_OFF;
|
private FMOD.MODE loopMode = FMOD.MODE.LOOP_OFF;
|
||||||
private uint FMODlenms = 0;
|
private uint FMODlenms = 0;
|
||||||
private float FMODVolume = 0.8f;
|
private float FMODVolume = 0.8f;
|
||||||
@@ -48,10 +46,11 @@ namespace Unity_Studio
|
|||||||
|
|
||||||
private Bitmap imageTexture = null;
|
private Bitmap imageTexture = null;
|
||||||
|
|
||||||
private bool startFilter = false;
|
//asset list sortign helpers
|
||||||
private bool isNameSorted = false;
|
private int firstSortColumn = -1;
|
||||||
private bool isTypeSorted = false;
|
private int secondSortColumn = 0;
|
||||||
private bool isSizeSorted = false;
|
private bool reverseSort = false;
|
||||||
|
private bool enableFiltering = false;
|
||||||
|
|
||||||
//tree search
|
//tree search
|
||||||
private int nextGObject = 0;
|
private int nextGObject = 0;
|
||||||
@@ -609,7 +608,6 @@ namespace Unity_Studio
|
|||||||
#region first loop - read asset data & create list
|
#region first loop - read asset data & create list
|
||||||
if (!dontLoadAssetsMenuItem.Checked)
|
if (!dontLoadAssetsMenuItem.Checked)
|
||||||
{
|
{
|
||||||
StatusStripUpdate("Building asset list...");
|
|
||||||
assetListView.BeginUpdate();
|
assetListView.BeginUpdate();
|
||||||
progressBar1.Value = 0;
|
progressBar1.Value = 0;
|
||||||
progressBar1.Maximum = totalAssetCount;
|
progressBar1.Maximum = totalAssetCount;
|
||||||
@@ -618,6 +616,8 @@ namespace Unity_Studio
|
|||||||
|
|
||||||
foreach (var assetsFile in assetsfileList)
|
foreach (var assetsFile in assetsfileList)
|
||||||
{
|
{
|
||||||
|
StatusStripUpdate("Building asset list from " + Path.GetFileName(assetsFile.filePath));
|
||||||
|
|
||||||
var a_Stream = assetsFile.a_Stream;
|
var a_Stream = assetsFile.a_Stream;
|
||||||
var fileGen = assetsFile.fileGen;
|
var fileGen = assetsFile.fileGen;
|
||||||
//var m_version = assetsFile.m_version;
|
//var m_version = assetsFile.m_version;
|
||||||
@@ -752,9 +752,10 @@ namespace Unity_Studio
|
|||||||
visibleAssets = exportableAssets;
|
visibleAssets = exportableAssets;
|
||||||
assetListView.VirtualListSize = visibleAssets.Count;
|
assetListView.VirtualListSize = visibleAssets.Count;
|
||||||
|
|
||||||
assetListView.AutoResizeColumn(1, ColumnHeaderAutoResizeStyle.ColumnContent);
|
//won't work because ListView is not visible
|
||||||
assetListView.AutoResizeColumn(2, ColumnHeaderAutoResizeStyle.ColumnContent);
|
//assetListView.AutoResizeColumn(1, ColumnHeaderAutoResizeStyle.ColumnContent);
|
||||||
resizeNameColumn();
|
//assetListView.AutoResizeColumn(2, ColumnHeaderAutoResizeStyle.ColumnContent);
|
||||||
|
//resizeAssetListColumns();
|
||||||
|
|
||||||
assetListView.EndUpdate();
|
assetListView.EndUpdate();
|
||||||
progressBar1.Value = 0;
|
progressBar1.Value = 0;
|
||||||
@@ -764,13 +765,13 @@ namespace Unity_Studio
|
|||||||
#region second loop - build tree structure
|
#region second loop - build tree structure
|
||||||
if (!dontBuildHierarchyMenuItem.Checked)
|
if (!dontBuildHierarchyMenuItem.Checked)
|
||||||
{
|
{
|
||||||
StatusStripUpdate("Building tree structure...");
|
|
||||||
sceneTreeView.BeginUpdate();
|
sceneTreeView.BeginUpdate();
|
||||||
progressBar1.Value = 0;
|
progressBar1.Value = 0;
|
||||||
progressBar1.Maximum = totalTreeNodes;
|
progressBar1.Maximum = totalTreeNodes;
|
||||||
|
|
||||||
foreach (var assetsFile in assetsfileList)
|
foreach (var assetsFile in assetsfileList)
|
||||||
{
|
{
|
||||||
|
StatusStripUpdate("Building tree structure from " + Path.GetFileName(assetsFile.filePath));
|
||||||
GameObject fileNode = new GameObject(null);
|
GameObject fileNode = new GameObject(null);
|
||||||
fileNode.Text = Path.GetFileName(assetsFile.filePath);
|
fileNode.Text = Path.GetFileName(assetsFile.filePath);
|
||||||
|
|
||||||
@@ -867,6 +868,7 @@ namespace Unity_Studio
|
|||||||
{
|
{
|
||||||
case 0: treeSearch.Select(); break;
|
case 0: treeSearch.Select(); break;
|
||||||
case 1:
|
case 1:
|
||||||
|
resizeAssetListColumns(); //required because the ListView is not visible on app launch
|
||||||
classPreviewPanel.Visible = false;
|
classPreviewPanel.Visible = false;
|
||||||
previewPanel.Visible = true;
|
previewPanel.Visible = true;
|
||||||
listSearch.Select();
|
listSearch.Select();
|
||||||
@@ -965,9 +967,62 @@ namespace Unity_Studio
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void resizeAssetListColumns()
|
||||||
|
{
|
||||||
|
assetListView.AutoResizeColumn(1, ColumnHeaderAutoResizeStyle.HeaderSize);
|
||||||
|
assetListView.AutoResizeColumn(1, ColumnHeaderAutoResizeStyle.ColumnContent);
|
||||||
|
assetListView.AutoResizeColumn(2, ColumnHeaderAutoResizeStyle.HeaderSize);
|
||||||
|
assetListView.AutoResizeColumn(2, ColumnHeaderAutoResizeStyle.ColumnContent);
|
||||||
|
|
||||||
|
var test = SystemInformation.VerticalScrollBarWidth;
|
||||||
|
var vscroll = ((float)visibleAssets.Count / (float)assetListView.Height) > 0.0567f;
|
||||||
|
columnHeaderName.Width = assetListView.Width - columnHeaderType.Width - columnHeaderSize.Width - (vscroll ? 25 : 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void tabPage2_Resize(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
resizeAssetListColumns();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*private void splitContainer1_Resize(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
switch (tabControl1.SelectedIndex)
|
||||||
|
{
|
||||||
|
case 1: resizeAssetListColumns(); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void splitContainer1_SplitterMoved(object sender, SplitterEventArgs e)
|
||||||
|
{
|
||||||
|
switch (tabControl1.SelectedIndex)
|
||||||
|
{
|
||||||
|
case 1: resizeAssetListColumns(); break;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
private void listSearch_Enter(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (listSearch.Text == " Filter ")
|
||||||
|
{
|
||||||
|
listSearch.Text = "";
|
||||||
|
listSearch.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||||
|
enableFiltering = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void listSearch_Leave(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (listSearch.Text == "")
|
||||||
|
{
|
||||||
|
enableFiltering = false;
|
||||||
|
listSearch.Text = " Filter ";
|
||||||
|
listSearch.ForeColor = System.Drawing.SystemColors.GrayText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void ListSearchTextChanged(object sender, EventArgs e)
|
private void ListSearchTextChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (startFilter)
|
if (enableFiltering)
|
||||||
{
|
{
|
||||||
assetListView.BeginUpdate();
|
assetListView.BeginUpdate();
|
||||||
assetListView.SelectedIndices.Clear();
|
assetListView.SelectedIndices.Clear();
|
||||||
@@ -978,65 +1033,49 @@ namespace Unity_Studio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void listSearch_Enter(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (listSearch.Text == " Filter ")
|
|
||||||
{
|
|
||||||
listSearch.Text = "";
|
|
||||||
listSearch.ForeColor = System.Drawing.SystemColors.WindowText;
|
|
||||||
startFilter = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void listSearch_Leave(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (listSearch.Text == "")
|
|
||||||
{
|
|
||||||
startFilter = false;
|
|
||||||
listSearch.Text = " Filter ";
|
|
||||||
listSearch.ForeColor = System.Drawing.SystemColors.GrayText;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void assetListView_ColumnClick(object sender, ColumnClickEventArgs e)
|
private void assetListView_ColumnClick(object sender, ColumnClickEventArgs e)
|
||||||
{
|
{
|
||||||
|
if (firstSortColumn != e.Column)
|
||||||
|
{
|
||||||
|
reverseSort = false;
|
||||||
|
secondSortColumn = firstSortColumn;
|
||||||
|
}
|
||||||
|
else { reverseSort = !reverseSort; }
|
||||||
|
firstSortColumn = e.Column;
|
||||||
|
|
||||||
assetListView.BeginUpdate();
|
assetListView.BeginUpdate();
|
||||||
assetListView.SelectedIndices.Clear();
|
assetListView.SelectedIndices.Clear();
|
||||||
switch (e.Column)
|
switch (e.Column)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
if (isNameSorted) { visibleAssets.Reverse(); }
|
visibleAssets.Sort(delegate (AssetPreloadData a, AssetPreloadData b)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
visibleAssets.Sort((x, y) => x.Text.CompareTo(y.Text));
|
int xdiff = reverseSort ? b.Text.CompareTo(a.Text) : a.Text.CompareTo(b.Text);
|
||||||
isNameSorted = true;
|
if (xdiff != 0) return xdiff;
|
||||||
}
|
else return secondSortColumn == 1 ? a.TypeString.CompareTo(b.TypeString) : a.exportSize.CompareTo(b.exportSize);
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (isTypeSorted) { visibleAssets.Reverse(); }
|
visibleAssets.Sort(delegate (AssetPreloadData a, AssetPreloadData b)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
visibleAssets.Sort((x, y) => x.TypeString.CompareTo(y.TypeString));
|
int xdiff = reverseSort ? b.TypeString.CompareTo(a.TypeString) : a.TypeString.CompareTo(b.TypeString);
|
||||||
isTypeSorted = true;
|
if (xdiff != 0) return xdiff;
|
||||||
}
|
else return secondSortColumn == 2 ? a.exportSize.CompareTo(b.exportSize) : a.Text.CompareTo(b.Text);
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (isSizeSorted) { visibleAssets.Reverse(); }
|
visibleAssets.Sort(delegate (AssetPreloadData a, AssetPreloadData b)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
visibleAssets.Sort((x, y) => x.exportSize.CompareTo(y.exportSize));
|
int xdiff = reverseSort ? b.exportSize.CompareTo(a.exportSize) : a.exportSize.CompareTo(b.exportSize);
|
||||||
isSizeSorted = true;
|
if (xdiff != 0) return xdiff;
|
||||||
}
|
else return secondSortColumn == 1 ? a.TypeString.CompareTo(b.TypeString) : a.Text.CompareTo(b.Text);
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
assetListView.EndUpdate();
|
assetListView.EndUpdate();
|
||||||
}
|
|
||||||
|
|
||||||
private void resizeNameColumn()
|
resizeAssetListColumns();
|
||||||
{
|
|
||||||
var vscroll = ((float)assetListView.VirtualListSize / (float)assetListView.Height) > 0.0567f;
|
|
||||||
columnHeaderName.Width = assetListView.Width - columnHeaderType.Width - columnHeaderSize.Width - (vscroll ? 25 : 5);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void selectAsset(object sender, ListViewItemSelectionChangedEventArgs e)
|
private void selectAsset(object sender, ListViewItemSelectionChangedEventArgs e)
|
||||||
@@ -1049,6 +1088,7 @@ namespace Unity_Studio
|
|||||||
fontPreviewBox.Visible = false;
|
fontPreviewBox.Visible = false;
|
||||||
FMODpanel.Visible = false;
|
FMODpanel.Visible = false;
|
||||||
lastLoadedAsset = null;
|
lastLoadedAsset = null;
|
||||||
|
StatusStripUpdate("");
|
||||||
|
|
||||||
FMOD.RESULT result;
|
FMOD.RESULT result;
|
||||||
if (sound != null)
|
if (sound != null)
|
||||||
@@ -1088,23 +1128,6 @@ namespace Unity_Studio
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void splitContainer1_Resize(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
switch (tabControl1.TabIndex)
|
|
||||||
{
|
|
||||||
case 1: resizeNameColumn(); break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void splitContainer1_SplitterMoved(object sender, SplitterEventArgs e)
|
|
||||||
{
|
|
||||||
switch (tabControl1.TabIndex)
|
|
||||||
{
|
|
||||||
case 1: resizeNameColumn(); break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void PreviewAsset(AssetPreloadData asset)
|
private void PreviewAsset(AssetPreloadData asset)
|
||||||
{
|
{
|
||||||
switch (asset.Type2)
|
switch (asset.Type2)
|
||||||
@@ -1147,6 +1170,7 @@ namespace Unity_Studio
|
|||||||
previewPanel.BackgroundImage = imageTexture;
|
previewPanel.BackgroundImage = imageTexture;
|
||||||
previewPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
previewPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||||
}
|
}
|
||||||
|
else { StatusStripUpdate("Unsupported image for preview. Try to export."); }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -1155,7 +1179,7 @@ namespace Unity_Studio
|
|||||||
{
|
{
|
||||||
AudioClip m_AudioClip = new AudioClip(asset, true);
|
AudioClip m_AudioClip = new AudioClip(asset, true);
|
||||||
|
|
||||||
if (m_AudioClip.m_Type != 22 && m_AudioClip.m_Type != 1)
|
if (m_AudioClip.m_Type == 13 && m_AudioClip.m_Type == 14 && m_AudioClip.m_Type == 20)
|
||||||
{
|
{
|
||||||
//MemoryStream memoryStream = new MemoryStream(m_AudioData, true);
|
//MemoryStream memoryStream = new MemoryStream(m_AudioData, true);
|
||||||
//System.Media.SoundPlayer soundPlayer = new System.Media.SoundPlayer(memoryStream);
|
//System.Media.SoundPlayer soundPlayer = new System.Media.SoundPlayer(memoryStream);
|
||||||
@@ -1202,7 +1226,7 @@ namespace Unity_Studio
|
|||||||
ERRCHECK(result);
|
ERRCHECK(result);
|
||||||
FMODinfoLabel.Text = FMODfrequency.ToString() + " Hz";
|
FMODinfoLabel.Text = FMODfrequency.ToString() + " Hz";
|
||||||
}
|
}
|
||||||
else { StatusStripUpdate("Unsuported format"); }
|
else { StatusStripUpdate("Unsuported audio format"); }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -1225,7 +1249,7 @@ namespace Unity_Studio
|
|||||||
{
|
{
|
||||||
unityFont m_Font = new unityFont(asset);
|
unityFont m_Font = new unityFont(asset);
|
||||||
|
|
||||||
if (m_Font.extension != ".otf" && m_Font.m_FontData.Length > 0)
|
if (m_Font.extension != ".otf" && m_Font.m_FontData != null)
|
||||||
{
|
{
|
||||||
IntPtr data = Marshal.AllocCoTaskMem(m_Font.m_FontData.Length);
|
IntPtr data = Marshal.AllocCoTaskMem(m_Font.m_FontData.Length);
|
||||||
Marshal.Copy(m_Font.m_FontData, 0, data, m_Font.m_FontData.Length);
|
Marshal.Copy(m_Font.m_FontData, 0, data, m_Font.m_FontData.Length);
|
||||||
@@ -1266,6 +1290,7 @@ namespace Unity_Studio
|
|||||||
fontPreviewBox.SelectionFont = new Font(pfc.Families[0], 72, FontStyle.Regular);
|
fontPreviewBox.SelectionFont = new Font(pfc.Families[0], 72, FontStyle.Regular);
|
||||||
fontPreviewBox.Visible = true;
|
fontPreviewBox.Visible = true;
|
||||||
}
|
}
|
||||||
|
else { StatusStripUpdate("Unsupported font for preview. Try to export."); }
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2921,25 +2946,28 @@ namespace Unity_Studio
|
|||||||
{
|
{
|
||||||
unityFont m_Font = new unityFont(asset);
|
unityFont m_Font = new unityFont(asset);
|
||||||
|
|
||||||
string fontPath = exportPath + "\\" + asset.Text;
|
if (m_Font.m_FontData != null)
|
||||||
if (uniqueNames.Checked) { fontPath += " #" + asset.uniqueID; }
|
|
||||||
fontPath += m_Font.extension;
|
|
||||||
|
|
||||||
if (File.Exists(fontPath))
|
|
||||||
{
|
{
|
||||||
StatusStripUpdate("Font file " + Path.GetFileName(fontPath) + " already exists");
|
string fontPath = exportPath + "\\" + asset.Text;
|
||||||
}
|
if (uniqueNames.Checked) { fontPath += " #" + asset.uniqueID; }
|
||||||
else
|
fontPath += m_Font.extension;
|
||||||
{
|
|
||||||
StatusStripUpdate("Exporting Font: " + Path.GetFileName(fontPath));
|
|
||||||
|
|
||||||
using (BinaryWriter writer = new BinaryWriter(File.Open(fontPath, FileMode.Create)))
|
if (File.Exists(fontPath))
|
||||||
{
|
{
|
||||||
writer.Write(m_Font.m_FontData);
|
StatusStripUpdate("Font file " + Path.GetFileName(fontPath) + " already exists");
|
||||||
writer.Close();
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
StatusStripUpdate("Exporting Font: " + Path.GetFileName(fontPath));
|
||||||
|
|
||||||
exportCount += 1;
|
using (BinaryWriter writer = new BinaryWriter(File.Open(fontPath, FileMode.Create)))
|
||||||
|
{
|
||||||
|
writer.Write(m_Font.m_FontData);
|
||||||
|
writer.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
exportCount += 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -3023,7 +3051,6 @@ namespace Unity_Studio
|
|||||||
enablePreview.Checked = (bool)Properties.Settings.Default["enablePreview"];
|
enablePreview.Checked = (bool)Properties.Settings.Default["enablePreview"];
|
||||||
openAfterExport.Checked = (bool)Properties.Settings.Default["openAfterExport"];
|
openAfterExport.Checked = (bool)Properties.Settings.Default["openAfterExport"];
|
||||||
assetGroupOptions.SelectedIndex = (int)Properties.Settings.Default["assetGroupOption"];
|
assetGroupOptions.SelectedIndex = (int)Properties.Settings.Default["assetGroupOption"];
|
||||||
resizeNameColumn();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetForm()
|
private void resetForm()
|
||||||
@@ -3057,6 +3084,10 @@ namespace Unity_Studio
|
|||||||
fontPreviewBox.Visible = false;
|
fontPreviewBox.Visible = false;
|
||||||
lastSelectedItem = null;
|
lastSelectedItem = null;
|
||||||
lastLoadedAsset = null;
|
lastLoadedAsset = null;
|
||||||
|
firstSortColumn = -1;
|
||||||
|
secondSortColumn = 0;
|
||||||
|
reverseSort = false;
|
||||||
|
enableFiltering = false;
|
||||||
|
|
||||||
FMODinit();
|
FMODinit();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user