34 Commits

Author SHA1 Message Date
Perfare
1ecf4c8c27 Release 0.8.0 2017-09-06 01:12:55 +08:00
Perfare
3dea2936d7 fixed bug 2017-09-06 01:03:54 +08:00
Perfare
e4533b4ec3 Add json file to read Shader 2017-08-21 22:00:28 +08:00
Perfare
9d87fead21 move glsl file to resource file 2017-08-21 19:51:32 +08:00
Perfare
14bd7f9789 try to read shader after Unity 5.4 2017-08-21 09:20:00 +08:00
Perfare
d02a4ea02e rewrite TextAsset.cs and Shader.cs 2017-08-21 07:10:30 +08:00
Perfare
14829c5e1b update TextureFormat 2017-08-21 06:52:31 +08:00
Perfare
ef29d220e0 Fixes #73 2017-08-21 06:46:46 +08:00
Perfare
14ec7c8259 support Unity 2017.1.0
fixed show "bundle file" original file
2017-07-15 15:27:09 +08:00
Perfare
9687f823fb Add "show original file" right click menu 2017-06-30 16:11:16 +08:00
Perfare
bb36839774 fix bug in export RGB565 format texture 2017-06-22 15:31:38 +08:00
Perfare
b0114520a8 fixed bug 2017-06-22 08:51:20 +08:00
Perfare
8a3af0bfba rewrite export mesh 2017-06-22 06:59:16 +08:00
Perfare
65a13e97c4 Add some simple judgment 2017-06-22 05:29:51 +08:00
Perfare
fe6b7760b0 fixed bug 2017-06-20 17:14:27 +08:00
Perfare
b319e92b3e fixed bug 2017-04-21 11:14:05 +08:00
Perfare
06b8fcea64 fix vertex color 2017-04-13 15:21:57 +08:00
Perfare
100238d232 fixed bug 2017-04-12 14:43:41 +08:00
Perfare
df3e5b31cd Release 0.7.0 2017-04-11 16:21:37 +08:00
Perfare
a04c0d0223 Update README.md 2017-04-11 15:06:40 +08:00
Perfare
d1ec1c29a4 cleanup code 2017-04-10 03:13:08 +08:00
Perfare
a928660dd3 Fixed some bugs 2017-04-10 00:50:33 +08:00
Perfare
e37a04e05b Modify project file
Fixed some bugs
2017-04-09 09:59:31 +08:00
Perfare
2c721272dd support Unity 5.6.0f3 2017-04-04 08:19:26 +08:00
Perfare
6f3b438d92 Fixed read struct 2017-04-04 05:49:26 +08:00
Perfare
f8e7303169 support use asset original name when display and export 2017-04-01 04:28:46 +08:00
Perfare
bd18bfb8ea Move code
Fixed some bugs
2017-04-01 00:41:18 +08:00
Perfare
86843f81da Fix FileName 2017-03-31 16:41:36 +08:00
ordigdug
60cc81b2dd Added 32bit ManagedFbx.dll (#32) 2017-03-07 23:30:50 +08:00
ordigdug
cfbcdecfe6 Added ExportMesh support -- (#31)
utilizing a modified ManagedFbx
2017-03-07 00:20:21 +08:00
Perfare
45b9b781b1 Clean up code
Adjust UI
Fixed some bugs
2017-02-27 23:56:24 +08:00
Perfare
29068481f5 Move file
Update OpenTK to 2.0
Fixed bug in high resolution
2017-02-26 01:40:14 +08:00
ordigdug
384dd2e4e3 Mesh Preview Support (#26)
* Added OpenTK preview

* Bug fix

* Cleanup

* Initial Mesh preview support

* Mesh preview support

* Mesh preview - lighting and color
2017-02-25 18:04:05 +08:00
Perfare
b4bce77381 Support Wii U Asset
All types selection
2017-02-24 15:39:06 +08:00
39 changed files with 3373 additions and 1828 deletions

View File

@@ -1,6 +1,7 @@
**Unity Studio** is a tool for exploring, extracting and exporting assets from Unity games and apps.
# UnityStudio
Latest build: [![Build status](https://ci.appveyor.com/api/projects/status/amw5n3607g45n2v0?svg=true)](https://ci.appveyor.com/project/Perfare/unitystudio/branch/master/artifacts)
It is the continuation of my Unity Importer script for 3ds Max, and comprises all my research and reverse engineering of Unity file formats. It has been thoroughly tested with Unity builds from most platforms, ranging from Web, PC, Linux, MacOS to Xbox360, PS3, Android and iOS, and it is currently maintained to be compatible with Unity builds from 2.5.0 up to the 5.5.1f1 version.
Unity Studio is a tool for exploring, extracting and exporting assets from Unity games and apps. It has been tested with Unity builds from most platforms, ranging from Web, PC, Linux, MacOS to Xbox360, PS3, Android and iOS, and it is currently maintained to be compatible with Unity builds from 2.5 up to the 5.6 version.
## Current features
@@ -9,14 +10,15 @@ It is the continuation of my Unity Importer script for 3ds Max, and comprises al
* DDS (Alpha8, ARGB4444, RGB24, RGBA32, ARGB32, RGB565, R16, DXT1, DXT5, RGBA4444, BGRA32)
* PVR (YUY2, PVRTC_RGB2, PVRTC_RGBA2, PVRTC_RGB4, PVRTC_RGBA4, ETC_RGB4, ETC2_RGB, ETC2_RGBA1, ETC2_RGBA8, ASTC_RGB_4x4, ASTC_RGB_5x5, ASTC_RGB_6x6, ASTC_RGB_8x8, ASTC_RGB_10x10, ASTC_RGB_12x12, ASTC_RGBA_4x4, ASTC_RGBA_5x5, ASTC_RGBA_6x6, ASTC_RGBA_8x8, ASTC_RGBA_10x10, ASTC_RGBA_12x12, ETC_RGB4_3DS, ETC_RGBA8_3DS)
* KTX (RHalf, RGHalf, RGBAHalf, RFloat, RGFloat, RGBAFloat, BC4, BC5, BC6H, BC7, ATC_RGB4, ATC_RGBA8, EAC_R, EAC_R_SIGNED, EAC_RG, EAC_RG_SIGNED)
* **AudioClip**: fsb, mp3, ogg, wav, m4a, xbox wav (including streams from resource files)
* **AudioClip**: fsb, mp3, ogg, wav, m4a, xbox wav
* **Font**: ttf, otf
* **Mesh**: obj
* **TextAsset**
* **Shader**
* **MonoBehaviour**
* Support convert all textures to bmp, png or jpeg
* Support convert FSB file to wav
* Export to FBX, with complete hierarchy, transformations, materials and textures. Geometry is exported with normals, tangents, UV coordinates, vertex colors and deformers. Skeleton nodes can be exported either as bones or dummy deformers..
* Export to FBX, with complete hierarchy, transformations, materials and textures. Geometry is exported with normals, tangents, UV coordinates, vertex colors and deformers. Skeleton nodes can be exported either as bones or dummy deformers.
* Real-time preview window for the above-mentioned assets
* Diagnostics mode with useful tools for research

View File

@@ -5,22 +5,22 @@ VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity Studio", "Unity Studio\Unity Studio.csproj", "{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity Studio-x86", "Unity Studio\Unity Studio-x86.csproj", "{F5E07FB2-95E4-417F-943F-D439D9A03BBA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Debug|x64.ActiveCfg = Debug|x64
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Debug|x64.Build.0 = Debug|x64
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Debug|x86.ActiveCfg = Debug|x86
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Debug|x86.Build.0 = Debug|x86
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Release|x64.ActiveCfg = Release|x64
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Release|x64.Build.0 = Release|x64
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Release|x86.ActiveCfg = Release|x86
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Release|x86.Build.0 = Release|x86
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Debug|Any CPU.ActiveCfg = Debug|x64
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Debug|Any CPU.Build.0 = Debug|x64
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Release|Any CPU.ActiveCfg = Release|x64
{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}.Release|Any CPU.Build.0 = Release|x64
{F5E07FB2-95E4-417F-943F-D439D9A03BBA}.Debug|Any CPU.ActiveCfg = Debug|x86
{F5E07FB2-95E4-417F-943F-D439D9A03BBA}.Debug|Any CPU.Build.0 = Debug|x86
{F5E07FB2-95E4-417F-943F-D439D9A03BBA}.Release|Any CPU.ActiveCfg = Release|x86
{F5E07FB2-95E4-417F-943F-D439D9A03BBA}.Release|Any CPU.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -7,46 +7,46 @@ namespace SevenZip.Compression.LZMA
public static class SevenZipHelper
{
static int dictionary = 1 << 23;
static int dictionary = 1 << 23;
// static Int32 posStateBits = 2;
// static Int32 litContextBits = 3; // for normal files
// static Int32 posStateBits = 2;
// static Int32 litContextBits = 3; // for normal files
// UInt32 litContextBits = 0; // for 32-bit data
// static Int32 litPosBits = 0;
// static Int32 litPosBits = 0;
// UInt32 litPosBits = 2; // for 32-bit data
// static Int32 algorithm = 2;
// static Int32 numFastBytes = 128;
// static Int32 algorithm = 2;
// static Int32 numFastBytes = 128;
static bool eos = false;
static bool eos = false;
static CoderPropID[] propIDs =
{
CoderPropID.DictionarySize,
CoderPropID.PosStateBits,
CoderPropID.LitContextBits,
CoderPropID.LitPosBits,
CoderPropID.Algorithm,
CoderPropID.NumFastBytes,
CoderPropID.MatchFinder,
CoderPropID.EndMarker
};
static CoderPropID[] propIDs =
{
CoderPropID.DictionarySize,
CoderPropID.PosStateBits,
CoderPropID.LitContextBits,
CoderPropID.LitPosBits,
CoderPropID.Algorithm,
CoderPropID.NumFastBytes,
CoderPropID.MatchFinder,
CoderPropID.EndMarker
};
// these are the default properties, keeping it simple for now:
static object[] properties =
{
(Int32)(dictionary),
(Int32)(2),
(Int32)(3),
(Int32)(0),
(Int32)(2),
(Int32)(128),
"bt4",
eos
};
static object[] properties =
{
(Int32)(dictionary),
(Int32)(2),
(Int32)(3),
(Int32)(0),
(Int32)(2),
(Int32)(128),
"bt4",
eos
};
public static byte[] Compress(byte[] inputBytes)
@@ -54,7 +54,7 @@ namespace SevenZip.Compression.LZMA
MemoryStream inStream = new MemoryStream(inputBytes);
MemoryStream outStream = new MemoryStream();
SevenZip.Compression.LZMA.Encoder encoder = new SevenZip.Compression.LZMA.Encoder();
Encoder encoder = new Encoder();
encoder.SetCoderProperties(propIDs, properties);
encoder.WriteCoderProperties(outStream);
long fileSize = inStream.Length;
@@ -68,8 +68,8 @@ namespace SevenZip.Compression.LZMA
{
MemoryStream newInStream = new MemoryStream(inputBytes);
SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
Decoder decoder = new Decoder();
newInStream.Seek(0, 0);
MemoryStream newOutStream = new MemoryStream();
@@ -97,7 +97,7 @@ namespace SevenZip.Compression.LZMA
public static MemoryStream StreamDecompress(MemoryStream newInStream)
{
SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
Decoder decoder = new Decoder();
newInStream.Seek(0, 0);
MemoryStream newOutStream = new MemoryStream();
@@ -124,7 +124,7 @@ namespace SevenZip.Compression.LZMA
public static MemoryStream StreamDecompress(MemoryStream newInStream, long outSize)
{
SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
Decoder decoder = new Decoder();
newInStream.Seek(0, 0);
MemoryStream newOutStream = new MemoryStream();

View File

@@ -13,12 +13,12 @@ namespace Unity_Studio
public AboutBox()
{
InitializeComponent();
this.Text = String.Format("About {0}", AssemblyTitle);
this.labelProductName.Text = AssemblyProduct;
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
this.labelCopyright.Text = AssemblyCopyright;
this.labelCompanyName.Text = AssemblyCompany;
this.textBoxDescription.Text = AssemblyDescription;
Text = $"About {AssemblyTitle}";
labelProductName.Text = AssemblyProduct;
labelVersion.Text = $"Version {AssemblyVersion}";
labelCopyright.Text = AssemblyCopyright;
labelCompanyName.Text = AssemblyCompany;
textBoxDescription.Text = AssemblyDescription;
}
#region Assembly Attribute Accessors
@@ -40,13 +40,7 @@ namespace Unity_Studio
}
}
public string AssemblyVersion
{
get
{
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
}
}
public string AssemblyVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();
public string AssemblyDescription
{
@@ -103,7 +97,7 @@ namespace Unity_Studio
private void okButton_Click(object sender, EventArgs e)
{
this.Close();
Close();
}
}
}

View File

@@ -27,12 +27,12 @@ namespace Unity_Studio
showExpOpt.Checked = (bool)Properties.Settings.Default["showExpOpt"];
converttexture.Checked = (bool)Properties.Settings.Default["convertTexture"];
convertfsb.Checked = (bool)Properties.Settings.Default["convertfsb"];
string str = Properties.Settings.Default["convertType"] as string;
var str = (string)Properties.Settings.Default["convertType"];
foreach (Control c in panel1.Controls)
{
if (c.Text == str)
{
(c as RadioButton).Checked = true;
((RadioButton)c).Checked = true;
break;
}
}
@@ -57,21 +57,21 @@ namespace Unity_Studio
Properties.Settings.Default["convertfsb"] = convertfsb.Checked;
foreach (Control c in panel1.Controls)
{
if ((c as RadioButton).Checked)
if (((RadioButton)c).Checked)
{
Properties.Settings.Default["convertType"] = c.Text;
break;
}
}
Properties.Settings.Default.Save();
this.DialogResult = DialogResult.OK;
this.Close();
DialogResult = DialogResult.OK;
Close();
}
private void fbxCancel_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
DialogResult = DialogResult.Cancel;
Close();
}
private void exportDeformers_CheckedChanged(object sender, EventArgs e)

View File

@@ -13,6 +13,7 @@ namespace Unity_Studio
[STAThread]
static void Main()
{
OpenTK.Toolkit.Init(new OpenTK.ToolkitOptions { EnableHighResolution = false });
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new UnityStudioForm());

View File

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.6.6.0")]
[assembly: AssemblyFileVersion("0.6.6.0")]
[assembly: AssemblyVersion("0.8.0.0")]
[assembly: AssemblyFileVersion("0.8.0.0")]

View File

@@ -226,5 +226,17 @@ namespace Unity_Studio.Properties {
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;
}
}
}
}

View File

@@ -53,5 +53,8 @@
<Setting Name="convertType" Type="System.String" Scope="User">
<Value Profile="(Default)">PNG</Value>
</Setting>
<Setting Name="displayOriginalName" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>

120
Unity Studio/Resource1.Designer.cs generated Normal file
View File

@@ -0,0 +1,120 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Unity_Studio {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resource1 {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resource1() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Unity_Studio.Resource1", typeof(Resource1).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 使用此强类型资源类,为所有资源查找
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// 查找类似 #version 140
///
///in vec3 surfaceNormal;
///in vec3 toLightVector;
///in vec4 color;
///
///out vec4 outputColor;
///
///void main()
///{
/// vec3 lightColor = vec3(0.5, 0.5, 0.5);
///
/// // Ambient
/// float ambientStrength = 0.9;
/// vec3 ambient = ambientStrength * lightColor;
///
/// // Diffuse
/// vec3 unitNormal = normalize(surfaceNormal);
/// vec3 unitLightVector = normalize(toLightVector);
/// float nDotProduct = dot(unitNormal, unitLightVector);
/// float brightness = clamp(nDotProduct, 0, 1); // max(nDotProduct, 0.0);
/// vec3 diffuse [字符串的其余部分被截断]&quot;; 的本地化字符串。
/// </summary>
internal static string fs {
get {
return ResourceManager.GetString("fs", resourceCulture);
}
}
/// <summary>
/// 查找类似 #version 140
///
///in vec3 vertexPosition;
///in vec3 normalDirection;
///in vec4 vertexColor;
///uniform mat4 viewMatrix;
///
///out vec3 surfaceNormal;
///out vec3 toLightVector;
///out vec4 color;
///
///void main()
///{
/// vec3 lightPosition = vec3(200.0, 200.0, 200.0);
/// gl_Position = viewMatrix * vec4(vertexPosition, 1.0);
/// surfaceNormal = normalDirection;
/// toLightVector = lightPosition - vertexPosition;
/// color = vertexColor;
///} 的本地化字符串。
/// </summary>
internal static string vs {
get {
return ResourceManager.GetString("vs", resourceCulture);
}
}
}
}

170
Unity Studio/Resource1.resx Normal file
View File

@@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="fs" xml:space="preserve">
<value>#version 140
in vec3 surfaceNormal;
in vec3 toLightVector;
in vec4 color;
out vec4 outputColor;
void main()
{
vec3 lightColor = vec3(0.5, 0.5, 0.5);
// Ambient
float ambientStrength = 0.9;
vec3 ambient = ambientStrength * lightColor;
// Diffuse
vec3 unitNormal = normalize(surfaceNormal);
vec3 unitLightVector = normalize(toLightVector);
float nDotProduct = dot(unitNormal, unitLightVector);
float brightness = clamp(nDotProduct, 0, 1); // max(nDotProduct, 0.0);
vec3 diffuse = brightness * lightColor;
// Output Color
vec4 result = color * vec4((ambient + diffuse/2), 0.0);
outputColor = result;
}</value>
</data>
<data name="vs" xml:space="preserve">
<value>#version 140
in vec3 vertexPosition;
in vec3 normalDirection;
in vec4 vertexColor;
uniform mat4 viewMatrix;
out vec3 surfaceNormal;
out vec3 toLightVector;
out vec4 color;
void main()
{
vec3 lightPosition = vec3(200.0, 200.0, 200.0);
gl_Position = viewMatrix * vec4(vertexPosition, 1.0);
surfaceNormal = normalDirection;
toLightVector = lightPosition - vertexPosition;
color = vertexColor;
}</value>
</data>
</root>

90
Unity Studio/ShaderResource.Designer.cs generated Normal file
View File

@@ -0,0 +1,90 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace Unity_Studio {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class ShaderResource {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal ShaderResource() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Unity_Studio.ShaderResource", typeof(ShaderResource).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 使用此强类型资源类,为所有资源查找
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// 查找类似 [{&quot;Level&quot;:0,&quot;Type&quot;:&quot;string&quot;,&quot;Name&quot;:&quot;m_Name&quot;,&quot;Size&quot;:-1,&quot;Flag&quot;:32769},{&quot;Level&quot;:1,&quot;Type&quot;:&quot;Array&quot;,&quot;Name&quot;:&quot;Array&quot;,&quot;Size&quot;:-1,&quot;Flag&quot;:16385},{&quot;Level&quot;:2,&quot;Type&quot;:&quot;int&quot;,&quot;Name&quot;:&quot;size&quot;,&quot;Size&quot;:4,&quot;Flag&quot;:1},{&quot;Level&quot;:2,&quot;Type&quot;:&quot;char&quot;,&quot;Name&quot;:&quot;data&quot;,&quot;Size&quot;:1,&quot;Flag&quot;:1},{&quot;Level&quot;:0,&quot;Type&quot;:&quot;SerializedShader&quot;,&quot;Name&quot;:&quot;m_ParsedForm&quot;,&quot;Size&quot;:-1,&quot;Flag&quot;:32768},{&quot;Level&quot;:1,&quot;Type&quot;:&quot;SerializedProperties&quot;,&quot;Name&quot;:&quot;m_PropInfo&quot;,&quot;Size&quot;:-1,&quot;Flag&quot;:32768},{&quot;Level&quot;:2,&quot;Type&quot;:&quot;vector&quot;,&quot;Name&quot;:&quot;m_Props&quot;,&quot;Size&quot;:-1,&quot;Flag&quot;:32768},{&quot;Level&quot;:3,&quot;Type&quot;:&quot;Arr... 的本地化字符串。
/// </summary>
internal static string Shader20171 {
get {
return ResourceManager.GetString("Shader20171", resourceCulture);
}
}
/// <summary>
/// 查找类似 [{&quot;Level&quot;:0,&quot;Type&quot;:&quot;string&quot;,&quot;Name&quot;:&quot;m_Name&quot;,&quot;Size&quot;:-1,&quot;Flag&quot;:32769},{&quot;Level&quot;:1,&quot;Type&quot;:&quot;Array&quot;,&quot;Name&quot;:&quot;Array&quot;,&quot;Size&quot;:-1,&quot;Flag&quot;:16385},{&quot;Level&quot;:2,&quot;Type&quot;:&quot;int&quot;,&quot;Name&quot;:&quot;size&quot;,&quot;Size&quot;:4,&quot;Flag&quot;:1},{&quot;Level&quot;:2,&quot;Type&quot;:&quot;char&quot;,&quot;Name&quot;:&quot;data&quot;,&quot;Size&quot;:1,&quot;Flag&quot;:1},{&quot;Level&quot;:0,&quot;Type&quot;:&quot;SerializedShader&quot;,&quot;Name&quot;:&quot;m_ParsedForm&quot;,&quot;Size&quot;:-1,&quot;Flag&quot;:32768},{&quot;Level&quot;:1,&quot;Type&quot;:&quot;SerializedProperties&quot;,&quot;Name&quot;:&quot;m_PropInfo&quot;,&quot;Size&quot;:-1,&quot;Flag&quot;:32768},{&quot;Level&quot;:2,&quot;Type&quot;:&quot;vector&quot;,&quot;Name&quot;:&quot;m_Props&quot;,&quot;Size&quot;:-1,&quot;Flag&quot;:32768},{&quot;Level&quot;:3,&quot;Type&quot;:&quot;Arr... 的本地化字符串。
/// </summary>
internal static string Shader55 {
get {
return ResourceManager.GetString("Shader55", resourceCulture);
}
}
/// <summary>
/// 查找类似 [{&quot;Level&quot;:0,&quot;Type&quot;:&quot;string&quot;,&quot;Name&quot;:&quot;m_Name&quot;,&quot;Size&quot;:-1,&quot;Flag&quot;:32769},{&quot;Level&quot;:1,&quot;Type&quot;:&quot;Array&quot;,&quot;Name&quot;:&quot;Array&quot;,&quot;Size&quot;:-1,&quot;Flag&quot;:16385},{&quot;Level&quot;:2,&quot;Type&quot;:&quot;int&quot;,&quot;Name&quot;:&quot;size&quot;,&quot;Size&quot;:4,&quot;Flag&quot;:1},{&quot;Level&quot;:2,&quot;Type&quot;:&quot;char&quot;,&quot;Name&quot;:&quot;data&quot;,&quot;Size&quot;:1,&quot;Flag&quot;:1},{&quot;Level&quot;:0,&quot;Type&quot;:&quot;SerializedShader&quot;,&quot;Name&quot;:&quot;m_ParsedForm&quot;,&quot;Size&quot;:-1,&quot;Flag&quot;:32768},{&quot;Level&quot;:1,&quot;Type&quot;:&quot;SerializedProperties&quot;,&quot;Name&quot;:&quot;m_PropInfo&quot;,&quot;Size&quot;:-1,&quot;Flag&quot;:32768},{&quot;Level&quot;:2,&quot;Type&quot;:&quot;vector&quot;,&quot;Name&quot;:&quot;m_Props&quot;,&quot;Size&quot;:-1,&quot;Flag&quot;:32768},{&quot;Level&quot;:3,&quot;Type&quot;:&quot;Arr... 的本地化字符串。
/// </summary>
internal static string Shader56 {
get {
return ResourceManager.GetString("Shader56", resourceCulture);
}
}
}
}

File diff suppressed because one or more lines are too long

View 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);
}
}
}
}

View File

@@ -60,8 +60,8 @@ namespace Unity_Studio
{
int m_Stream = a_Stream.ReadInt32();
m_Size = a_Stream.ReadInt32();
if (m_Stream > 1)
var asize = m_Size % 4 != 0 ? m_Size + 4 - m_Size % 4 : m_Size;
if (m_Stream > 1 && preloadData.Size + preloadData.Offset - a_Stream.Position > asize)
{
m_Offset = a_Stream.ReadInt32();
m_Source = sourceFile.filePath + ".resS";
@@ -94,23 +94,21 @@ namespace Unity_Studio
if (readSwitch)
{
m_AudioData = new byte[m_Size];
if (m_Source == null)
{
a_Stream.Read(m_AudioData, 0, (int)m_Size);
m_AudioData = a_Stream.ReadBytes((int)m_Size);
}
else if (File.Exists(m_Source) ||
File.Exists(m_Source = Path.Combine(Path.GetDirectoryName(sourceFile.filePath), Path.GetFileName(m_Source))))
{
BinaryReader reader = new BinaryReader(File.OpenRead(m_Source));
reader.BaseStream.Position = m_Offset;
reader.Read(m_AudioData, 0, (int)m_Size);
m_AudioData = reader.ReadBytes((int)m_Size);
reader.Close();
}
else
{
EndianStream estream = null;
EndianStream estream;
if (UnityStudio.assetsfileandstream.TryGetValue(Path.GetFileName(m_Source), out estream))
{
estream.Position = m_Offset;

View File

@@ -58,10 +58,10 @@ namespace Unity_Studio
m_Tag = a_Stream.ReadUInt16();
m_IsActive = a_Stream.ReadBoolean();
base.Text = m_Name;
Text = m_Name;
preloadData.Text = m_Name;
//name should be unique
base.Name = uniqueID;
Name = uniqueID;
}
}
}

View File

@@ -15,7 +15,7 @@ namespace Unity_Studio
public TexEnv[] m_TexEnvs;
public strFloatPair[] m_Floats;
public strColorPair[] m_Colors;
public Material(AssetPreloadData preloadData)
{
var sourceFile = preloadData.sourceFile;
@@ -40,15 +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
{
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++)
@@ -56,9 +62,17 @@ namespace Unity_Studio
stringTagMap[i] = new string[2] { a_Stream.ReadAlignedString(a_Stream.ReadInt32()), a_Stream.ReadAlignedString(a_Stream.ReadInt32()) };
}
}
//m_SavedProperties
m_TexEnvs = new TexEnv[a_Stream.ReadInt32()];
//disabledShaderPasses
if ((sourceFile.version[0] == 5 && sourceFile.version[1] >= 6) || sourceFile.version[0] > 5)//5.6.0 and up
{
var size = a_Stream.ReadInt32();
for (int i = 0; i < size; i++)
{
a_Stream.ReadAlignedString(a_Stream.ReadInt32());
}
}
//m_SavedProperties
m_TexEnvs = new TexEnv[a_Stream.ReadInt32()];
for (int i = 0; i < m_TexEnvs.Length; i++)
{
TexEnv m_TexEnv = new TexEnv()

File diff suppressed because it is too large Load Diff

View File

@@ -23,16 +23,7 @@ namespace Unity_Studio
if (readSwitch)
{
preloadData.extension = ".txt";
a_Stream.Position = preloadData.Offset;
ClassStruct classStructure;
if (sourceFile.ClassStructures.TryGetValue(preloadData.Type1, out classStructure))
{
var member = classStructure.members;
var sb = new StringBuilder();
Read(sb, member, a_Stream);
serializedText = sb.ToString();
}
else
if ((serializedText = preloadData.ViewStruct()) == null)
{
var str = "PPtr<GameObject> m_GameObject\r\n";
str += "\tint m_FileID = " + m_GameObject.m_FileID + "\r\n";
@@ -58,124 +49,5 @@ namespace Unity_Studio
preloadData.SubItems.AddRange(new[] { preloadData.TypeString, preloadData.Size.ToString() });
}
}
private void Read(StringBuilder sb, List<ClassMember> members, EndianStream a_Stream)
{
for (int i = 0; i < members.Count; i++)
{
var member = members[i];
var level = member.Level;
var varTypeStr = member.Type;
var varNameStr = member.Name;
if (varTypeStr == "SInt8")//sbyte
{
var value = a_Stream.ReadSByte();
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
a_Stream.AlignStream(4);
}
else if (varTypeStr == "UInt8")//byte
{
var value = a_Stream.ReadByte();
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
a_Stream.AlignStream(4);
}
else if (varTypeStr == "short" || varTypeStr == "SInt16")//Int16
{
var value = a_Stream.ReadInt16();
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
a_Stream.AlignStream(4);
}
else if (varTypeStr == "UInt16" || varTypeStr == "unsigned short")//UInt16
{
var value = a_Stream.ReadUInt16();
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
a_Stream.AlignStream(4);
}
else if (varTypeStr == "int" || varTypeStr == "SInt32")//Int32
{
var value = a_Stream.ReadInt32();
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
a_Stream.AlignStream(4);
}
else if (varTypeStr == "UInt32" || varTypeStr == "unsigned int")//UInt32
{
var value = a_Stream.ReadUInt32();
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
a_Stream.AlignStream(4);
}
else if (varTypeStr == "long long" || varTypeStr == "SInt64")//Int64
{
var value = a_Stream.ReadInt64();
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
a_Stream.AlignStream(4);
}
else if (varTypeStr == "UInt64" || varTypeStr == "unsigned long long")//UInt64
{
var value = a_Stream.ReadUInt64();
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
a_Stream.AlignStream(4);
}
else if (varTypeStr == "float")//float
{
var value = a_Stream.ReadSingle();
sb.AppendFormat("{0}{1} {2} = {3:f}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
a_Stream.AlignStream(4);
}
else if (varTypeStr == "double")//double
{
var value = a_Stream.ReadDouble();
sb.AppendFormat("{0}{1} {2} = {3:f4}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
a_Stream.AlignStream(4);
}
else if (varTypeStr == "bool")//bool
{
var value = a_Stream.ReadBoolean();
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
a_Stream.AlignStream(4);
}
else if (varTypeStr == "string")//string
{
var value = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
sb.AppendFormat("{0}{1} {2} = \"{3}\"\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
i += 3;//skip
}
else if (varTypeStr == "Array")//Array
{
sb.AppendFormat("{0}{1} {2}\r\n", (new string('\t', level)), varTypeStr, varNameStr);
var size = a_Stream.ReadInt32();
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), "int", "size", size);
var array = ReadArray(members, level, i);
for (int j = 0; j < size; j++)
{
sb.AppendFormat("{0}[{1}]\r\n", (new string('\t', level + 1)), j);
Read(sb, array, a_Stream);
}
i += array.Count + 1;//skip
}
else
{
sb.AppendFormat("{0}{1} {2}\r\n", (new string('\t', level)), varTypeStr, varNameStr);
}
}
}
private List<ClassMember> ReadArray(List<ClassMember> members, int level, int index)
{
var member2 = new List<ClassMember>();
for (int i = index + 2; i < members.Count; i++)//skip int size
{
var member = members[i];
var level2 = member.Level;
if (level2 <= level)
{
return member2;
}
else
{
member2.Add(member);
}
}
return member2;
}
}
}

View File

@@ -1,4 +1,10 @@
using System.Text;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web.Script.Serialization;
using Lz4;
namespace Unity_Studio
{
@@ -6,7 +12,6 @@ namespace Unity_Studio
{
public string m_Name;
public byte[] m_Script;
public string m_PathName;
public Shader(AssetPreloadData preloadData, bool readSwitch)
{
@@ -23,44 +28,159 @@ namespace Unity_Studio
}
m_Name = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
if ((sourceFile.version[0] == 5 && sourceFile.version[1] >= 5) || sourceFile.version[0] > 5)
if (readSwitch)
{
if (readSwitch)
if (sourceFile.version[0] == 5 && sourceFile.version[1] >= 5 || sourceFile.version[0] > 5)//5.5.0 and up
{
m_Script = Encoding.UTF8.GetBytes("Serialized Shader can't be read");
a_Stream.Position = preloadData.Offset;
var str = (string)ShaderResource.ResourceManager.GetObject($"Shader{sourceFile.version[0]}{sourceFile.version[1]}");
var members = new JavaScriptSerializer().Deserialize<List<ClassMember>>(str);
m_Script = ReadSerializedShader(members, a_Stream);
}
else
{
if (m_Name != "") { preloadData.Text = m_Name; }
else { preloadData.Text = preloadData.TypeString + " #" + preloadData.uniqueID; }
preloadData.SubItems.AddRange(new[] { preloadData.TypeString, preloadData.Size.ToString() });
m_Script = a_Stream.ReadBytes(a_Stream.ReadInt32());
if (sourceFile.version[0] == 5 && sourceFile.version[1] >= 3) //5.3 - 5.4
{
a_Stream.AlignStream(4);
a_Stream.ReadAlignedString(a_Stream.ReadInt32());//m_PathName
var decompressedSize = a_Stream.ReadUInt32();
var m_SubProgramBlob = a_Stream.ReadBytes(a_Stream.ReadInt32());
var decompressedBytes = new byte[decompressedSize];
using (var mstream = new MemoryStream(m_SubProgramBlob))
{
var decoder = new Lz4DecoderStream(mstream);
decoder.Read(decompressedBytes, 0, (int)decompressedSize);
decoder.Dispose();
}
m_Script = m_Script.Concat(decompressedBytes.ToArray()).ToArray();
}
}
}
else
{
int m_Script_size = a_Stream.ReadInt32();
if (m_Name != "") { preloadData.Text = m_Name; }
else { preloadData.Text = preloadData.TypeString + " #" + preloadData.uniqueID; }
preloadData.SubItems.AddRange(new[] { preloadData.TypeString, preloadData.Size.ToString() });
}
}
if (readSwitch) //asset is read for preview or export
private static byte[] ReadSerializedShader(List<ClassMember> members, EndianStream a_Stream)
{
var offsets = new List<uint>();
var compressedLengths = new List<uint>();
var decompressedLengths = new List<uint>();
for (int i = 0; i < members.Count; i++)
{
var member = members[i];
var level = member.Level;
var varTypeStr = member.Type;
if (member.Name == "offsets")
{
m_Script = new byte[m_Script_size];
a_Stream.Read(m_Script, 0, m_Script_size);
if (m_Script[0] == 93) { m_Script = SevenZip.Compression.LZMA.SevenZipHelper.Decompress(m_Script); }
if (m_Script[0] == 60 || (m_Script[0] == 239 && m_Script[1] == 187 && m_Script[2] == 191 && m_Script[3] == 60)) { preloadData.extension = ".xml"; }
var offsets_size = a_Stream.ReadInt32();
for (int j = 0; j < offsets_size; j++)
{
offsets.Add(a_Stream.ReadUInt32());
}
var compressedLengths_size = a_Stream.ReadInt32();
for (int j = 0; j < compressedLengths_size; j++)
{
compressedLengths.Add(a_Stream.ReadUInt32());
}
var decompressedLengths_size = a_Stream.ReadInt32();
for (int j = 0; j < decompressedLengths_size; j++)
{
decompressedLengths.Add(a_Stream.ReadUInt32());
}
var compressedBlob = a_Stream.ReadBytes(a_Stream.ReadInt32());
var decompressedStream = new MemoryStream();
for (int j = 0; j < offsets.Count; j++)
{
var compressedBytes = new byte[compressedLengths[j]];
Array.Copy(compressedBlob, offsets[j], compressedBytes, 0, compressedLengths[j]);
var decompressedBytes = new byte[decompressedLengths[j]];
using (var mstream = new MemoryStream(compressedBytes))
{
var decoder = new Lz4DecoderStream(mstream);
decoder.Read(decompressedBytes, 0, (int)decompressedLengths[j]);
decoder.Dispose();
}
decompressedStream.Write(decompressedBytes, 0, decompressedBytes.Length);
}
var decompressedBlob = decompressedStream.ToArray();
return decompressedBlob;
}
var align = (member.Flag & 0x4000) != 0;
if (varTypeStr == "SInt8")//sbyte
{
a_Stream.ReadSByte();
}
else if (varTypeStr == "UInt8")//byte
{
a_Stream.ReadByte();
}
else if (varTypeStr == "short" || varTypeStr == "SInt16")//Int16
{
a_Stream.ReadInt16();
}
else if (varTypeStr == "UInt16" || varTypeStr == "unsigned short")//UInt16
{
a_Stream.ReadUInt16();
}
else if (varTypeStr == "int" || varTypeStr == "SInt32")//Int32
{
a_Stream.ReadInt32();
}
else if (varTypeStr == "UInt32" || varTypeStr == "unsigned int")//UInt32
{
a_Stream.ReadUInt32();
}
else if (varTypeStr == "long long" || varTypeStr == "SInt64")//Int64
{
a_Stream.ReadInt64();
}
else if (varTypeStr == "UInt64" || varTypeStr == "unsigned long long")//UInt64
{
a_Stream.ReadUInt64();
}
else if (varTypeStr == "float")//float
{
a_Stream.ReadSingle();
}
else if (varTypeStr == "double")//double
{
a_Stream.ReadDouble();
}
else if (varTypeStr == "bool")//bool
{
a_Stream.ReadBoolean();
}
else if (varTypeStr == "string")//string
{
a_Stream.ReadAlignedString(a_Stream.ReadInt32());
i += 3;//skip
}
else if (varTypeStr == "Array")//Array
{
if ((members[i - 1].Flag & 0x4000) != 0)
align = true;
var size = a_Stream.ReadInt32();
var array = AssetPreloadData.ReadArray(members, level, i);
for (int j = 0; j < size; j++)
{
ReadSerializedShader(array, a_Stream);
}
i += array.Count + 1;//skip
}
else
{
byte lzmaTest = a_Stream.ReadByte();
a_Stream.Position += m_Script_size - 1;
if (m_Name != "") { preloadData.Text = m_Name; }
else { preloadData.Text = preloadData.TypeString + " #" + preloadData.uniqueID; }
preloadData.SubItems.AddRange(new[] { preloadData.TypeString, preloadData.Size.ToString() });
align = false;
}
a_Stream.AlignStream(4);
m_PathName = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
if (align)
a_Stream.AlignStream(4);
}
return null;
}
}
}

View File

@@ -10,7 +10,6 @@ namespace Unity_Studio
{
public string m_Name;
public byte[] m_Script;
public string m_PathName;
public TextAsset(AssetPreloadData preloadData, bool readSwitch)
{
@@ -28,36 +27,16 @@ namespace Unity_Studio
m_Name = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
int m_Script_size = a_Stream.ReadInt32();
if (readSwitch) //asset is read for preview or export
if (readSwitch)
{
m_Script = new byte[m_Script_size];
a_Stream.Read(m_Script, 0, m_Script_size);
if (m_Script[0] == 93)
{
try
{
m_Script = SevenZip.Compression.LZMA.SevenZipHelper.Decompress(m_Script);
}
catch { }
}
if (m_Script[0] == 60 || (m_Script[0] == 239 && m_Script[1] == 187 && m_Script[2] == 191 && m_Script[3] == 60)) { preloadData.extension = ".xml"; }
m_Script = a_Stream.ReadBytes(a_Stream.ReadInt32());
}
else
{
byte lzmaTest = a_Stream.ReadByte();
a_Stream.Position += m_Script_size - 1;
if (m_Name != "") { preloadData.Text = m_Name; }
else { preloadData.Text = preloadData.TypeString + " #" + preloadData.uniqueID; }
preloadData.SubItems.AddRange(new[] { preloadData.TypeString, preloadData.Size.ToString() });
}
a_Stream.AlignStream(4);
m_PathName = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
}
}
}

View File

@@ -126,7 +126,7 @@ namespace Unity_Studio
}
m_IsReadable = a_Stream.ReadBoolean(); //2.6.0 and up
m_ReadAllowed = a_Stream.ReadBoolean(); //3.0.0 and up
m_ReadAllowed = a_Stream.ReadBoolean(); //3.0.0 - 5.4
a_Stream.AlignStream(4);
m_ImageCount = a_Stream.ReadInt32();
@@ -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();
@@ -168,15 +172,14 @@ namespace Unity_Studio
if (File.Exists(path) ||
File.Exists(path = Path.Combine(Path.GetDirectoryName(sourceFile.filePath), Path.GetFileName(path))))
{
image_data = new byte[image_data_size];
BinaryReader reader = new BinaryReader(File.OpenRead(path));
reader.BaseStream.Position = offset;
reader.Read(image_data, 0, image_data_size);
image_data = reader.ReadBytes(image_data_size);
reader.Close();
}
else
{
EndianStream estream = null;
EndianStream estream;
if (UnityStudio.assetsfileandstream.TryGetValue(Path.GetFileName(path), out estream))
{
estream.Position = offset;
@@ -186,8 +189,7 @@ namespace Unity_Studio
}
else
{
image_data = new byte[image_data_size];
a_Stream.Read(image_data, 0, image_data_size);
image_data = a_Stream.ReadBytes(image_data_size);
}
switch (m_TextureFormat)
@@ -988,9 +990,26 @@ namespace Unity_Studio
private Bitmap RGB565ToBitmap()
{
var hObject = GCHandle.Alloc(image_data, GCHandleType.Pinned);
//stride = m_Width * 2 + m_Width * 2 % 4
//所以m_Width * 2不为4的倍数时需要在每行补上相应的像素
byte[] buff;
var padding = m_Width * 2 % 4;
var stride = m_Width * 2 + padding;
if (padding != 0)
{
buff = new byte[stride * m_Height];
for (int i = 0; i < m_Height; i++)
{
Array.Copy(image_data, i * m_Width * 2, buff, i * stride, m_Width * 2);
}
}
else
{
buff = image_data;
}
var hObject = GCHandle.Alloc(buff, GCHandleType.Pinned);
var pObject = hObject.AddrOfPinnedObject();
var bitmap = new Bitmap(m_Width, m_Height, m_Width * 2, PixelFormat.Format16bppRgb565, pObject);
var bitmap = new Bitmap(m_Width, m_Height, stride, PixelFormat.Format16bppRgb565, pObject);
hObject.Free();
return bitmap;
}
@@ -1077,6 +1096,7 @@ public enum TextureFormat
RGFloat,
RGBAFloat,
YUY2,
RGB9e5Float,
BC4 = 26,
BC5,
BC6H = 24,
@@ -1110,7 +1130,9 @@ public enum TextureFormat
ASTC_RGBA_10x10,
ASTC_RGBA_12x12,
ETC_RGB4_3DS,
ETC_RGBA8_3DS
ETC_RGBA8_3DS,
RG16,
R8
}
public static class KTXHeader

View File

@@ -20,5 +20,127 @@ namespace Unity_Studio
public AssetsFile sourceFile;
public string uniqueID;
public string ViewStruct()
{
var a_Stream = sourceFile.a_Stream;
a_Stream.Position = Offset;
ClassStruct classStructure;
if (sourceFile.ClassStructures.TryGetValue(Type1, out classStructure))
{
var member = classStructure.members;
var sb = new StringBuilder();
Read(sb, member, a_Stream);
return sb.ToString();
}
return null;
}
private static void Read(StringBuilder sb, List<ClassMember> members, EndianStream a_Stream)
{
for (int i = 0; i < members.Count; i++)
{
var member = members[i];
var level = member.Level;
var varTypeStr = member.Type;
var varNameStr = member.Name;
object value = null;
var align = (member.Flag & 0x4000) != 0;
var append = true;
if (varTypeStr == "SInt8")//sbyte
{
value = a_Stream.ReadSByte();
}
else if (varTypeStr == "UInt8")//byte
{
value = a_Stream.ReadByte();
}
else if (varTypeStr == "short" || varTypeStr == "SInt16")//Int16
{
value = a_Stream.ReadInt16();
}
else if (varTypeStr == "UInt16" || varTypeStr == "unsigned short")//UInt16
{
value = a_Stream.ReadUInt16();
}
else if (varTypeStr == "int" || varTypeStr == "SInt32")//Int32
{
value = a_Stream.ReadInt32();
}
else if (varTypeStr == "UInt32" || varTypeStr == "unsigned int")//UInt32
{
value = a_Stream.ReadUInt32();
}
else if (varTypeStr == "long long" || varTypeStr == "SInt64")//Int64
{
value = a_Stream.ReadInt64();
}
else if (varTypeStr == "UInt64" || varTypeStr == "unsigned long long")//UInt64
{
value = a_Stream.ReadUInt64();
}
else if (varTypeStr == "float")//float
{
value = a_Stream.ReadSingle();
}
else if (varTypeStr == "double")//double
{
value = a_Stream.ReadDouble();
}
else if (varTypeStr == "bool")//bool
{
value = a_Stream.ReadBoolean();
}
else if (varTypeStr == "string")//string
{
append = false;
var str = a_Stream.ReadAlignedString(a_Stream.ReadInt32());
sb.AppendFormat("{0}{1} {2} = \"{3}\"\r\n", (new string('\t', level)), varTypeStr, varNameStr, str);
i += 3;//skip
}
else if (varTypeStr == "Array")//Array
{
append = false;
if ((members[i - 1].Flag & 0x4000) != 0)
align = true;
sb.AppendFormat("{0}{1} {2}\r\n", (new string('\t', level)), varTypeStr, varNameStr);
var size = a_Stream.ReadInt32();
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), "int", "size", size);
var array = ReadArray(members, level, i);
for (int j = 0; j < size; j++)
{
sb.AppendFormat("{0}[{1}]\r\n", (new string('\t', level + 1)), j);
Read(sb, array, a_Stream);
}
i += array.Count + 1;//skip
}
else
{
append = false;
align = false;
sb.AppendFormat("{0}{1} {2}\r\n", (new string('\t', level)), varTypeStr, varNameStr);
}
if (append)
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
if (align)
a_Stream.AlignStream(4);
}
}
public static List<ClassMember> ReadArray(List<ClassMember> members, int level, int index)
{
var member2 = new List<ClassMember>();
for (int i = index + 2; i < members.Count; i++)//skip int size
{
var member = members[i];
var level2 = member.Level;
if (level2 <= level)
{
return member2;
}
member2.Add(member);
}
return member2;
}
}
}

View File

@@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace Unity_Studio
{
@@ -9,8 +11,10 @@ namespace Unity_Studio
{
public EndianStream a_Stream;
public string filePath;
public string bundlePath;
public string fileName;
public int fileGen;
public bool valid;
public string m_Version = "2.5.0f5";
public int[] version = new int[4] { 0, 0, 0, 0 };
public string[] buildType;
@@ -31,10 +35,6 @@ namespace Unity_Studio
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" };
public static string[] strverSplit = {
".", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
"u", "v", "w", "x", "y", "z", "\n"
};
#region cmmon string
private static Dictionary<int, string> baseStrings = new Dictionary<int, string>()
@@ -151,210 +151,270 @@ namespace Unity_Studio
public AssetsFile(string fullName, EndianStream fileStream)
{
//if (memFile != null) { Stream = new EndianStream(memFile, endianType); }
//else { Stream = new EndianStream(File.OpenRead(fileName), endianType); }
a_Stream = fileStream;
filePath = fullName;
fileName = Path.GetFileName(fullName);
int tableSize = a_Stream.ReadInt32();
int dataEnd = a_Stream.ReadInt32();
fileGen = a_Stream.ReadInt32();
uint dataOffset = a_Stream.ReadUInt32();
sharedAssetsList[0].fileName = Path.GetFileName(fullName); //reference itself because sharedFileIDs start from 1
switch (fileGen)
try
{
case 6://2.5.0 - 2.6.1
{
a_Stream.Position = (dataEnd - tableSize);
a_Stream.Position += 1;
int tableSize = a_Stream.ReadInt32();
int dataEnd = a_Stream.ReadInt32();
fileGen = a_Stream.ReadInt32();
uint dataOffset = a_Stream.ReadUInt32();
sharedAssetsList[0].fileName = Path.GetFileName(fullName); //reference itself because sharedFileIDs start from 1
switch (fileGen)
{
case 6: //2.5.0 - 2.6.1
{
a_Stream.Position = (dataEnd - tableSize);
a_Stream.Position += 1;
break;
}
case 7: //3.0.0 beta
{
a_Stream.Position = (dataEnd - tableSize);
a_Stream.Position += 1;
m_Version = a_Stream.ReadStringToNull();
break;
}
case 8: //3.0.0 - 3.4.2
{
a_Stream.Position = (dataEnd - tableSize);
a_Stream.Position += 1;
m_Version = a_Stream.ReadStringToNull();
platform = a_Stream.ReadInt32();
break;
}
case 9: //3.5.0 - 4.6.x
{
a_Stream.Position += 4; //azero
m_Version = a_Stream.ReadStringToNull();
platform = a_Stream.ReadInt32();
break;
}
case 14: //5.0.0 beta and final
case 15: //5.0.1 - 5.4
case 16: //??.. no sure
case 17: //5.5.0 and up
{
a_Stream.Position += 4; //azero
m_Version = a_Stream.ReadStringToNull();
platform = a_Stream.ReadInt32();
baseDefinitions = a_Stream.ReadBoolean();
break;
}
default:
{
//MessageBox.Show("Unsupported Unity version!" + fileGen, "Unity Studio Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
if (platform > 255 || platform < 0)
{
byte[] b32 = BitConverter.GetBytes(platform);
Array.Reverse(b32);
platform = BitConverter.ToInt32(b32, 0);
//endianType = EndianType.LittleEndian;
a_Stream.endian = EndianType.LittleEndian;
}
switch (platform)
{
case -2:
platformStr = "Unity Package";
break;
}
case 7://3.0.0 beta
{
a_Stream.Position = (dataEnd - tableSize);
a_Stream.Position += 1;
m_Version = a_Stream.ReadStringToNull();
case 4:
platformStr = "OSX";
break;
}
case 8://3.0.0 - 3.4.2
{
a_Stream.Position = (dataEnd - tableSize);
a_Stream.Position += 1;
m_Version = a_Stream.ReadStringToNull();
platform = a_Stream.ReadInt32();
case 5:
platformStr = "PC";
break;
}
case 9://3.5.0 - 4.6.x
{
a_Stream.Position += 4;//azero
m_Version = a_Stream.ReadStringToNull();
platform = a_Stream.ReadInt32();
case 6:
platformStr = "Web";
break;
}
case 14://5.0.0 beta and final
case 15://5.0.1 - 5.4
case 16://??.. no sure
case 17://5.5.0 and up
{
a_Stream.Position += 4;//azero
m_Version = a_Stream.ReadStringToNull();
platform = a_Stream.ReadInt32();
baseDefinitions = a_Stream.ReadBoolean();
case 7:
platformStr = "Web streamed";
break;
}
default:
case 9:
platformStr = "iOS";
break;
case 10:
platformStr = "PS3";
break;
case 11:
platformStr = "Xbox 360";
break;
case 13:
platformStr = "Android";
break;
case 16:
platformStr = "Google NaCl";
break;
case 19:
platformStr = "CollabPreview";
break;
case 21:
platformStr = "WP8";
break;
case 25:
platformStr = "Linux";
break;
case 29:
platformStr = "Wii U";
break;
default:
platformStr = "Unknown Platform";
break;
}
int baseCount = a_Stream.ReadInt32();
for (int i = 0; i < baseCount; i++)
{
if (fileGen < 14)
{
//MessageBox.Show("Unsupported Unity version!" + fileGen, "Unity Studio Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
int classID = a_Stream.ReadInt32();
string baseType = a_Stream.ReadStringToNull();
string baseName = a_Stream.ReadStringToNull();
a_Stream.Position += 20;
int memberCount = a_Stream.ReadInt32();
var cb = new List<ClassMember>();
for (int m = 0; m < memberCount; m++)
{
readBase(cb, 1);
}
var aClass = new ClassStruct() { ID = classID, Text = (baseType + " " + baseName), members = cb };
aClass.SubItems.Add(classID.ToString());
ClassStructures.Add(classID, aClass);
}
}
if (platform > 255 || platform < 0)
{
byte[] b32 = BitConverter.GetBytes(platform);
Array.Reverse(b32);
platform = BitConverter.ToInt32(b32, 0);
//endianType = EndianType.LittleEndian;
a_Stream.endian = EndianType.LittleEndian;
}
switch (platform)
{
case -2: platformStr = "Unity Package"; break;
case 4: platformStr = "OSX"; break;
case 5: platformStr = "PC"; break;
case 6: platformStr = "Web"; break;
case 7: platformStr = "Web streamed"; break;
case 9: platformStr = "iOS"; break;
case 10: platformStr = "PS3"; break;
case 11: platformStr = "Xbox 360"; break;
case 13: platformStr = "Android"; break;
case 16: platformStr = "Google NaCl"; break;
case 21: platformStr = "WP8"; break;
case 25: platformStr = "Linux"; break;
default: platformStr = "Unknown Platform"; break;
}
int baseCount = a_Stream.ReadInt32();
for (int i = 0; i < baseCount; i++)
{
if (fileGen < 14)
{
int classID = a_Stream.ReadInt32();
string baseType = a_Stream.ReadStringToNull();
string baseName = a_Stream.ReadStringToNull();
a_Stream.Position += 20;
int memberCount = a_Stream.ReadInt32();
var cb = new List<ClassMember>();
for (int m = 0; m < memberCount; m++) { readBase(cb, 1); }
var aClass = new ClassStruct() { ID = classID, Text = (baseType + " " + baseName), members = cb };
aClass.SubItems.Add(classID.ToString());
ClassStructures.Add(classID, aClass);
}
else { readBase5(); }
}
if (fileGen >= 7 && fileGen < 14) { a_Stream.Position += 4; }//azero
int assetCount = a_Stream.ReadInt32();
#region asset preload table
string assetIDfmt = "D" + assetCount.ToString().Length; //format for unique ID
for (int i = 0; i < assetCount; i++)
{
//each table entry is aligned individually, not the whole table
if (fileGen >= 14) { a_Stream.AlignStream(4); }
AssetPreloadData asset = new AssetPreloadData();
if (fileGen < 14) { asset.m_PathID = a_Stream.ReadInt32(); }
else { asset.m_PathID = a_Stream.ReadInt64(); }
asset.Offset = a_Stream.ReadUInt32();
asset.Offset += dataOffset;
asset.Size = a_Stream.ReadInt32();
if (fileGen > 15)
{
int index = a_Stream.ReadInt32();
asset.Type1 = classIDs[index][0];
asset.Type2 = (ushort)classIDs[index][1];
}
else
{
asset.Type1 = a_Stream.ReadInt32();
asset.Type2 = a_Stream.ReadUInt16();
a_Stream.Position += 2;
}
if (fileGen == 15)
{
byte unknownByte = a_Stream.ReadByte();
//this is a single byte, not an int32
//the next entry is aligned after this
//but not the last!
if (unknownByte != 0)
else
{
//bool investigate = true;
readBase5();
}
}
string typeString;
if (ClassIDReference.Names.TryGetValue(asset.Type2, out typeString))
if (fileGen >= 7 && fileGen < 14)
{
asset.TypeString = typeString;
}
else
{
asset.TypeString = "Unknown Type " + asset.Type2;
a_Stream.Position += 4; //azero
}
asset.uniqueID = i.ToString(assetIDfmt);
int assetCount = a_Stream.ReadInt32();
asset.sourceFile = this;
#region asset preload table
string assetIDfmt = "D" + assetCount.ToString().Length; //format for unique ID
preloadTable.Add(asset.m_PathID, asset);
#region read BuildSettings to get version for unity 2.x files
if (asset.Type2 == 141 && fileGen == 6)
for (int i = 0; i < assetCount; i++)
{
long nextAsset = a_Stream.Position;
//each table entry is aligned individually, not the whole table
if (fileGen >= 14)
{
a_Stream.AlignStream(4);
}
BuildSettings BSettings = new BuildSettings(asset);
m_Version = BSettings.m_Version;
AssetPreloadData asset = new AssetPreloadData();
if (fileGen < 14)
{
asset.m_PathID = a_Stream.ReadInt32();
}
else
{
asset.m_PathID = a_Stream.ReadInt64();
}
asset.Offset = a_Stream.ReadUInt32();
asset.Offset += dataOffset;
asset.Size = a_Stream.ReadInt32();
if (fileGen > 15)
{
int index = a_Stream.ReadInt32();
asset.Type1 = classIDs[index][0];
asset.Type2 = (ushort)classIDs[index][1];
}
else
{
asset.Type1 = a_Stream.ReadInt32();
asset.Type2 = a_Stream.ReadUInt16();
a_Stream.Position += 2;
}
if (fileGen == 15)
{
byte unknownByte = a_Stream.ReadByte();
//this is a single byte, not an int32
//the next entry is aligned after this
//but not the last!
if (unknownByte != 0)
{
//bool investigate = true;
}
}
a_Stream.Position = nextAsset;
string typeString;
if (ClassIDReference.Names.TryGetValue(asset.Type2, out typeString))
{
asset.TypeString = typeString;
}
else
{
asset.TypeString = "Unknown Type " + asset.Type2;
}
asset.uniqueID = i.ToString(assetIDfmt);
asset.sourceFile = this;
preloadTable.Add(asset.m_PathID, asset);
#region read BuildSettings to get version for unity 2.x files
if (asset.Type2 == 141 && fileGen == 6)
{
long nextAsset = a_Stream.Position;
BuildSettings BSettings = new BuildSettings(asset);
m_Version = BSettings.m_Version;
a_Stream.Position = nextAsset;
}
#endregion
}
#endregion
}
#endregion
buildType = m_Version.Split(buildTypeSplit, StringSplitOptions.RemoveEmptyEntries);
var strver = m_Version.Split(strverSplit, StringSplitOptions.RemoveEmptyEntries);
version = Array.ConvertAll(strver, int.Parse);
if (fileGen >= 14)
{
//this looks like a list of assets that need to be preloaded in memory before anytihng else
int someCount = a_Stream.ReadInt32();
for (int i = 0; i < someCount; i++)
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
{
int num1 = a_Stream.ReadInt32();
a_Stream.AlignStream(4);
long m_PathID = a_Stream.ReadInt64();
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
int someCount = a_Stream.ReadInt32();
for (int i = 0; i < someCount; i++)
{
int num1 = a_Stream.ReadInt32();
a_Stream.AlignStream(4);
long m_PathID = a_Stream.ReadInt64();
}
}
}
int sharedFileCount = a_Stream.ReadInt32();
for (int i = 0; i < sharedFileCount; i++)
int sharedFileCount = a_Stream.ReadInt32();
for (int i = 0; i < sharedFileCount; i++)
{
UnityShared shared = new UnityShared();
shared.aName = a_Stream.ReadStringToNull();
a_Stream.Position += 20;
string sharedFileName = a_Stream.ReadStringToNull(); //relative path
shared.fileName = sharedFileName.Replace("/", "\\");
sharedAssetsList.Add(shared);
}
valid = true;
}
catch
{
UnityShared shared = new UnityShared();
shared.aName = a_Stream.ReadStringToNull();
a_Stream.Position += 20;
string sharedFileName = a_Stream.ReadStringToNull(); //relative path
shared.fileName = sharedFileName.Replace("/", "\\");
sharedAssetsList.Add(shared);
}
}
@@ -367,8 +427,7 @@ namespace Unity_Studio
int index = a_Stream.ReadInt32();
int isArray = a_Stream.ReadInt32();
int num0 = a_Stream.ReadInt32();
int num1 = a_Stream.ReadInt16();
int num2 = a_Stream.ReadInt16();
int flag = a_Stream.ReadInt32();
int childrenCount = a_Stream.ReadInt32();
//Debug.WriteLine(baseFormat + " " + baseName + " " + childrenCount);
@@ -377,7 +436,8 @@ namespace Unity_Studio
Level = level - 1,
Type = varType,
Name = varName,
Size = size
Size = size,
Flag = flag
});
for (int i = 0; i < childrenCount; i++) { readBase(cb, level + 1); }
}
@@ -450,11 +510,11 @@ namespace Unity_Studio
test = a_Stream.ReadUInt16();
string varNameStr;
if (test == 0) { varNameStr = varStrings.Substring(varNameIndex, varStrings.IndexOf('\0', varNameIndex) - varNameIndex); }
else { varNameStr = baseStrings.ContainsKey(varTypeIndex) ? baseStrings[varNameIndex] : varNameIndex.ToString(); }
else { varNameStr = baseStrings.ContainsKey(varNameIndex) ? baseStrings[varNameIndex] : varNameIndex.ToString(); }
int size = a_Stream.ReadInt32();
int index = a_Stream.ReadInt32();
int num1 = a_Stream.ReadInt32();
int flag = a_Stream.ReadInt32();
if (index == 0) { className = varTypeStr + " " + varNameStr; }
else
@@ -464,7 +524,8 @@ namespace Unity_Studio
Level = level - 1,
Type = varTypeStr,
Name = varNameStr,
Size = size
Size = size,
Flag = flag
});
}

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
using Lz4;
using SevenZip.Compression.LZMA;
namespace Unity_Studio
{
@@ -97,7 +97,7 @@ namespace Unity_Studio
byte[] lzmaBuffer = new byte[lzmaSize];
b_Stream.Read(lzmaBuffer, 0, lzmaSize);
using (var lzmaStream = new EndianStream(SevenZip.Compression.LZMA.SevenZipHelper.StreamDecompress(new MemoryStream(lzmaBuffer)), EndianType.BigEndian))
using (var lzmaStream = new EndianStream(SevenZipHelper.StreamDecompress(new MemoryStream(lzmaBuffer)), EndianType.BigEndian))
{
getFiles(lzmaStream, 0);
}
@@ -166,15 +166,14 @@ namespace Unity_Studio
EndianStream blocksInfo;
switch (flag & 0x3F)
{
default:
case 0://None
default://None
{
blocksInfo = new EndianStream(new MemoryStream(blocksInfoBytes), EndianType.BigEndian);
break;
}
case 1://LZMA
{
blocksInfo = new EndianStream(SevenZip.Compression.LZMA.SevenZipHelper.StreamDecompress(new MemoryStream(blocksInfoBytes)), EndianType.BigEndian);
blocksInfo = new EndianStream(SevenZipHelper.StreamDecompress(new MemoryStream(blocksInfoBytes)), EndianType.BigEndian);
break;
}
case 2://LZ4
@@ -206,8 +205,7 @@ namespace Unity_Studio
var compressedBytes = b_Stream.ReadBytes(compressedSize);
switch (flag & 0x3F)
{
default:
case 0://None
default://None
{
assetsDataStream.Write(compressedBytes, 0, compressedSize);
break;
@@ -217,7 +215,7 @@ namespace Unity_Studio
var uncompressedBytes = new byte[uncompressedSize];
using (var mstream = new MemoryStream(compressedBytes))
{
var decoder = SevenZip.Compression.LZMA.SevenZipHelper.StreamDecompress(mstream, uncompressedSize);
var decoder = SevenZipHelper.StreamDecompress(mstream, uncompressedSize);
decoder.Read(uncompressedBytes, 0, uncompressedSize);
decoder.Dispose();
}

View File

@@ -31,6 +31,7 @@ namespace Unity_Studio
public string Type;
public string Name;
public int Size;
public int Flag;
}
public static class ClassIDReference

View File

@@ -20,115 +20,115 @@ namespace Unity_Studio
public EndianStream(Stream stream, EndianType endian) : base(stream) { }
public long Position { get { return base.BaseStream.Position; } set { base.BaseStream.Position = value; } }
public long Position { get { return BaseStream.Position; } set { BaseStream.Position = value; } }
public override short ReadInt16()
{
if (endian == EndianType.BigEndian)
{
a16 = base.ReadBytes(2);
a16 = ReadBytes(2);
Array.Reverse(a16);
return BitConverter.ToInt16(a16, 0);
}
else return base.ReadInt16();
return base.ReadInt16();
}
public override int ReadInt32()
{
if (endian == EndianType.BigEndian)
{
a32 = base.ReadBytes(4);
a32 = ReadBytes(4);
Array.Reverse(a32);
return BitConverter.ToInt32(a32, 0);
}
else return base.ReadInt32();
return base.ReadInt32();
}
public override long ReadInt64()
{
if (endian == EndianType.BigEndian)
{
a64 = base.ReadBytes(8);
a64 = ReadBytes(8);
Array.Reverse(a64);
return BitConverter.ToInt64(a64, 0);
}
else return base.ReadInt64();
return base.ReadInt64();
}
public override ushort ReadUInt16()
{
if (endian == EndianType.BigEndian)
{
a16 = base.ReadBytes(2);
a16 = ReadBytes(2);
Array.Reverse(a16);
return BitConverter.ToUInt16(a16, 0);
}
else return base.ReadUInt16();
return base.ReadUInt16();
}
public override uint ReadUInt32()
{
if (endian == EndianType.BigEndian)
{
a32 = base.ReadBytes(4);
a32 = ReadBytes(4);
Array.Reverse(a32);
return BitConverter.ToUInt32(a32, 0);
}
else return base.ReadUInt32();
return base.ReadUInt32();
}
public override ulong ReadUInt64()
{
if (endian == EndianType.BigEndian)
{
a64 = base.ReadBytes(8);
a64 = ReadBytes(8);
Array.Reverse(a64);
return BitConverter.ToUInt64(a64, 0);
}
else return base.ReadUInt64();
return base.ReadUInt64();
}
public override float ReadSingle()
{
if (endian == EndianType.BigEndian)
{
a32 = base.ReadBytes(4);
a32 = ReadBytes(4);
Array.Reverse(a32);
return BitConverter.ToSingle(a32, 0);
}
else return base.ReadSingle();
return base.ReadSingle();
}
public override double ReadDouble()
{
if (endian == EndianType.BigEndian)
{
a64 = base.ReadBytes(8);
a64 = ReadBytes(8);
Array.Reverse(a64);
return BitConverter.ToUInt64(a64, 0);
}
else return base.ReadDouble();
return base.ReadDouble();
}
public string ReadASCII(int length)
{
return Encoding.ASCII.GetString(base.ReadBytes(length));
return Encoding.ASCII.GetString(ReadBytes(length));
}
public void AlignStream(int alignment)
{
long pos = base.BaseStream.Position;
long pos = BaseStream.Position;
//long padding = alignment - pos + (pos / alignment) * alignment;
//if (padding != alignment) { base.BaseStream.Position += padding; }
if ((pos % alignment) != 0) { base.BaseStream.Position += alignment - (pos % alignment); }
if ((pos % alignment) != 0) { BaseStream.Position += alignment - (pos % alignment); }
}
public string ReadAlignedString(int length)
{
if (length > 0 && length < (base.BaseStream.Length - base.BaseStream.Position))//crude failsafe
if (length > 0 && length < (BaseStream.Length - BaseStream.Position))//crude failsafe
{
byte[] stringData = new byte[length];
base.Read(stringData, 0, length);
Read(stringData, 0, length);
var result = Encoding.UTF8.GetString(stringData); //must verify strange characters in PS3
/*string result = "";
@@ -142,14 +142,14 @@ namespace Unity_Studio
AlignStream(4);
return result;
}
else { return ""; }
return "";
}
public string ReadStringToNull()
{
var bytes = new List<byte>();
byte b;
while ((b = ReadByte()) != 0)
while (BaseStream.Position != BaseStream.Length && (b = ReadByte()) != 0)
bytes.Add(b);
return Encoding.UTF8.GetString(bytes.ToArray());
}

View File

@@ -7,538 +7,525 @@ using System.IO;
namespace Lz4
{
public class Lz4DecoderStream : Stream
{
public Lz4DecoderStream()
{
}
public class Lz4DecoderStream : Stream
{
public Lz4DecoderStream(Stream input, long inputLength = long.MaxValue)
{
Reset(input, inputLength);
}
public Lz4DecoderStream( Stream input, long inputLength = long.MaxValue )
{
Reset( input, inputLength );
}
public void Reset(Stream input, long inputLength = long.MaxValue)
{
this.inputLength = inputLength;
this.input = input;
public void Reset( Stream input, long inputLength = long.MaxValue )
{
this.inputLength = inputLength;
this.input = input;
phase = DecodePhase.ReadToken;
phase = DecodePhase.ReadToken;
decodeBufferPos = 0;
litLen = 0;
matLen = 0;
matDst = 0;
decodeBufferPos = 0;
inBufPos = DecBufLen;
inBufEnd = DecBufLen;
}
litLen = 0;
matLen = 0;
matDst = 0;
public override void Close()
{
this.input = null;
}
inBufPos = DecBufLen;
inBufEnd = DecBufLen;
}
private long inputLength;
private Stream input;
public override void Close()
{
input = null;
}
//because we might not be able to match back across invocations,
//we have to keep the last window's worth of bytes around for reuse
//we use a circular buffer for this - every time we write into this
//buffer, we also write the same into our output buffer
private long inputLength;
private Stream input;
private const int DecBufLen = 0x10000;
private const int DecBufMask = 0xFFFF;
//because we might not be able to match back across invocations,
//we have to keep the last window's worth of bytes around for reuse
//we use a circular buffer for this - every time we write into this
//buffer, we also write the same into our output buffer
private const int InBufLen = 128;
private const int DecBufLen = 0x10000;
private const int DecBufMask = 0xFFFF;
private byte[] decodeBuffer = new byte[DecBufLen + InBufLen];
private int decodeBufferPos, inBufPos, inBufEnd;
private const int InBufLen = 128;
//we keep track of which phase we're in so that we can jump right back
//into the correct part of decoding
private byte[] decodeBuffer = new byte[DecBufLen + InBufLen];
private int decodeBufferPos, inBufPos, inBufEnd;
private DecodePhase phase;
//we keep track of which phase we're in so that we can jump right back
//into the correct part of decoding
private enum DecodePhase
{
ReadToken,
ReadExLiteralLength,
CopyLiteral,
ReadOffset,
ReadExMatchLength,
CopyMatch,
}
private DecodePhase phase;
//state within interruptable phases and across phase boundaries is
//kept here - again, so that we can punt out and restart freely
private enum DecodePhase
{
ReadToken,
ReadExLiteralLength,
CopyLiteral,
ReadOffset,
ReadExMatchLength,
CopyMatch,
}
private int litLen, matLen, matDst;
//state within interruptable phases and across phase boundaries is
//kept here - again, so that we can punt out and restart freely
public override int Read( byte[] buffer, int offset, int count )
{
private int litLen, matLen, matDst;
public override int Read(byte[] buffer, int offset, int count)
{
#if CHECK_ARGS
if( buffer == null )
throw new ArgumentNullException( "buffer" );
if( offset < 0 || count < 0 || buffer.Length - count < offset )
throw new ArgumentOutOfRangeException();
if (buffer == null)
throw new ArgumentNullException("buffer");
if (offset < 0 || count < 0 || buffer.Length - count < offset)
throw new ArgumentOutOfRangeException();
if( input == null )
throw new InvalidOperationException();
if (input == null)
throw new InvalidOperationException();
#endif
int nRead, nToRead = count;
int nRead, nToRead = count;
var decBuf = decodeBuffer;
var decBuf = decodeBuffer;
//the stringy gotos are obnoxious, but their purpose is to
//make it *blindingly* obvious how the state machine transitions
//back and forth as it reads - remember, we can yield out of
//this routine in several places, and we must be able to re-enter
//and pick up where we left off!
//the stringy gotos are obnoxious, but their purpose is to
//make it *blindingly* obvious how the state machine transitions
//back and forth as it reads - remember, we can yield out of
//this routine in several places, and we must be able to re-enter
//and pick up where we left off!
#if LOCAL_SHADOW
var phase = this.phase;
var inBufPos = this.inBufPos;
var inBufEnd = this.inBufEnd;
#endif
switch( phase )
{
case DecodePhase.ReadToken:
goto readToken;
switch (phase)
{
case DecodePhase.ReadToken:
goto readToken;
case DecodePhase.ReadExLiteralLength:
goto readExLiteralLength;
case DecodePhase.ReadExLiteralLength:
goto readExLiteralLength;
case DecodePhase.CopyLiteral:
goto copyLiteral;
case DecodePhase.CopyLiteral:
goto copyLiteral;
case DecodePhase.ReadOffset:
goto readOffset;
case DecodePhase.ReadOffset:
goto readOffset;
case DecodePhase.ReadExMatchLength:
goto readExMatchLength;
case DecodePhase.ReadExMatchLength:
goto readExMatchLength;
case DecodePhase.CopyMatch:
goto copyMatch;
}
case DecodePhase.CopyMatch:
goto copyMatch;
}
readToken:
int tok;
if( inBufPos < inBufEnd )
{
tok = decBuf[inBufPos++];
}
else
{
readToken:
int tok;
if (inBufPos < inBufEnd)
{
tok = decBuf[inBufPos++];
}
else
{
#if LOCAL_SHADOW
this.inBufPos = inBufPos;
#endif
tok = ReadByteCore();
tok = ReadByteCore();
#if LOCAL_SHADOW
inBufPos = this.inBufPos;
inBufEnd = this.inBufEnd;
#endif
#if CHECK_EOF
if( tok == -1 )
goto finish;
if (tok == -1)
goto finish;
#endif
}
}
litLen = tok >> 4;
matLen = (tok & 0xF) + 4;
litLen = tok >> 4;
matLen = (tok & 0xF) + 4;
switch( litLen )
{
case 0:
phase = DecodePhase.ReadOffset;
goto readOffset;
switch (litLen)
{
case 0:
phase = DecodePhase.ReadOffset;
goto readOffset;
case 0xF:
phase = DecodePhase.ReadExLiteralLength;
goto readExLiteralLength;
case 0xF:
phase = DecodePhase.ReadExLiteralLength;
goto readExLiteralLength;
default:
phase = DecodePhase.CopyLiteral;
goto copyLiteral;
}
default:
phase = DecodePhase.CopyLiteral;
goto copyLiteral;
}
readExLiteralLength:
int exLitLen;
if( inBufPos < inBufEnd )
{
exLitLen = decBuf[inBufPos++];
}
else
{
readExLiteralLength:
int exLitLen;
if (inBufPos < inBufEnd)
{
exLitLen = decBuf[inBufPos++];
}
else
{
#if LOCAL_SHADOW
this.inBufPos = inBufPos;
#endif
exLitLen = ReadByteCore();
#if LOCAL_SHADOW
exLitLen = ReadByteCore();
#if LOCAL_SHADOW
inBufPos = this.inBufPos;
inBufEnd = this.inBufEnd;
#endif
#if CHECK_EOF
if( exLitLen == -1 )
goto finish;
if (exLitLen == -1)
goto finish;
#endif
}
}
litLen += exLitLen;
if( exLitLen == 255 )
goto readExLiteralLength;
litLen += exLitLen;
if (exLitLen == 255)
goto readExLiteralLength;
phase = DecodePhase.CopyLiteral;
goto copyLiteral;
phase = DecodePhase.CopyLiteral;
goto copyLiteral;
copyLiteral:
int nReadLit = litLen < nToRead ? litLen : nToRead;
if( nReadLit != 0 )
{
if( inBufPos + nReadLit <= inBufEnd )
{
int ofs = offset;
copyLiteral:
int nReadLit = litLen < nToRead ? litLen : nToRead;
if (nReadLit != 0)
{
if (inBufPos + nReadLit <= inBufEnd)
{
int ofs = offset;
for( int c = nReadLit; c-- != 0; )
buffer[ofs++] = decBuf[inBufPos++];
for (int c = nReadLit; c-- != 0;)
buffer[ofs++] = decBuf[inBufPos++];
nRead = nReadLit;
}
else
{
nRead = nReadLit;
}
else
{
#if LOCAL_SHADOW
this.inBufPos = inBufPos;
#endif
nRead = ReadCore( buffer, offset, nReadLit );
nRead = ReadCore(buffer, offset, nReadLit);
#if LOCAL_SHADOW
inBufPos = this.inBufPos;
inBufEnd = this.inBufEnd;
#endif
#if CHECK_EOF
if( nRead == 0 )
goto finish;
if (nRead == 0)
goto finish;
#endif
}
}
offset += nRead;
nToRead -= nRead;
offset += nRead;
nToRead -= nRead;
litLen -= nRead;
litLen -= nRead;
if( litLen != 0 )
goto copyLiteral;
}
if (litLen != 0)
goto copyLiteral;
}
if( nToRead == 0 )
goto finish;
if (nToRead == 0)
goto finish;
phase = DecodePhase.ReadOffset;
goto readOffset;
phase = DecodePhase.ReadOffset;
goto readOffset;
readOffset:
if( inBufPos + 1 < inBufEnd )
{
matDst = (decBuf[inBufPos + 1] << 8) | decBuf[inBufPos];
inBufPos += 2;
}
else
{
readOffset:
if (inBufPos + 1 < inBufEnd)
{
matDst = (decBuf[inBufPos + 1] << 8) | decBuf[inBufPos];
inBufPos += 2;
}
else
{
#if LOCAL_SHADOW
this.inBufPos = inBufPos;
#endif
matDst = ReadOffsetCore();
matDst = ReadOffsetCore();
#if LOCAL_SHADOW
inBufPos = this.inBufPos;
inBufEnd = this.inBufEnd;
#endif
#if CHECK_EOF
if( matDst == -1 )
goto finish;
if (matDst == -1)
goto finish;
#endif
}
}
if( matLen == 15 + 4 )
{
phase = DecodePhase.ReadExMatchLength;
goto readExMatchLength;
}
else
{
phase = DecodePhase.CopyMatch;
goto copyMatch;
}
if (matLen == 15 + 4)
{
phase = DecodePhase.ReadExMatchLength;
goto readExMatchLength;
}
else
{
phase = DecodePhase.CopyMatch;
goto copyMatch;
}
readExMatchLength:
int exMatLen;
if( inBufPos < inBufEnd )
{
exMatLen = decBuf[inBufPos++];
}
else
{
readExMatchLength:
int exMatLen;
if (inBufPos < inBufEnd)
{
exMatLen = decBuf[inBufPos++];
}
else
{
#if LOCAL_SHADOW
this.inBufPos = inBufPos;
#endif
exMatLen = ReadByteCore();
exMatLen = ReadByteCore();
#if LOCAL_SHADOW
inBufPos = this.inBufPos;
inBufEnd = this.inBufEnd;
#endif
#if CHECK_EOF
if( exMatLen == -1 )
goto finish;
if (exMatLen == -1)
goto finish;
#endif
}
}
matLen += exMatLen;
if( exMatLen == 255 )
goto readExMatchLength;
matLen += exMatLen;
if (exMatLen == 255)
goto readExMatchLength;
phase = DecodePhase.CopyMatch;
goto copyMatch;
phase = DecodePhase.CopyMatch;
goto copyMatch;
copyMatch:
int nCpyMat = matLen < nToRead ? matLen : nToRead;
if( nCpyMat != 0 )
{
nRead = count - nToRead;
copyMatch:
int nCpyMat = matLen < nToRead ? matLen : nToRead;
if (nCpyMat != 0)
{
nRead = count - nToRead;
int bufDst = matDst - nRead;
if( bufDst > 0 )
{
//offset is fairly far back, we need to pull from the buffer
int bufDst = matDst - nRead;
if (bufDst > 0)
{
//offset is fairly far back, we need to pull from the buffer
int bufSrc = decodeBufferPos - bufDst;
if( bufSrc < 0 )
bufSrc += DecBufLen;
int bufCnt = bufDst < nCpyMat ? bufDst : nCpyMat;
int bufSrc = decodeBufferPos - bufDst;
if (bufSrc < 0)
bufSrc += DecBufLen;
int bufCnt = bufDst < nCpyMat ? bufDst : nCpyMat;
for( int c = bufCnt; c-- != 0; )
buffer[offset++] = decBuf[bufSrc++ & DecBufMask];
}
else
{
bufDst = 0;
}
for (int c = bufCnt; c-- != 0;)
buffer[offset++] = decBuf[bufSrc++ & DecBufMask];
}
else
{
bufDst = 0;
}
int sOfs = offset - matDst;
for( int i = bufDst; i < nCpyMat; i++ )
buffer[offset++] = buffer[sOfs++];
int sOfs = offset - matDst;
for (int i = bufDst; i < nCpyMat; i++)
buffer[offset++] = buffer[sOfs++];
nToRead -= nCpyMat;
matLen -= nCpyMat;
}
nToRead -= nCpyMat;
matLen -= nCpyMat;
}
if( nToRead == 0 )
goto finish;
if (nToRead == 0)
goto finish;
phase = DecodePhase.ReadToken;
goto readToken;
phase = DecodePhase.ReadToken;
goto readToken;
finish:
nRead = count - nToRead;
finish:
nRead = count - nToRead;
int nToBuf = nRead < DecBufLen ? nRead : DecBufLen;
int repPos = offset - nToBuf;
int nToBuf = nRead < DecBufLen ? nRead : DecBufLen;
int repPos = offset - nToBuf;
if( nToBuf == DecBufLen )
{
Buffer.BlockCopy( buffer, repPos, decBuf, 0, DecBufLen );
decodeBufferPos = 0;
}
else
{
int decPos = decodeBufferPos;
if (nToBuf == DecBufLen)
{
Buffer.BlockCopy(buffer, repPos, decBuf, 0, DecBufLen);
decodeBufferPos = 0;
}
else
{
int decPos = decodeBufferPos;
while( nToBuf-- != 0 )
decBuf[decPos++ & DecBufMask] = buffer[repPos++];
while (nToBuf-- != 0)
decBuf[decPos++ & DecBufMask] = buffer[repPos++];
decodeBufferPos = decPos & DecBufMask;
}
decodeBufferPos = decPos & DecBufMask;
}
#if LOCAL_SHADOW
this.phase = phase;
this.inBufPos = inBufPos;
#endif
return nRead;
}
return nRead;
}
private int ReadByteCore()
{
var buf = decodeBuffer;
private int ReadByteCore()
{
var buf = decodeBuffer;
if( inBufPos == inBufEnd )
{
int nRead = input.Read( buf, DecBufLen,
InBufLen < inputLength ? InBufLen : (int)inputLength );
if (inBufPos == inBufEnd)
{
int nRead = input.Read(buf, DecBufLen,
InBufLen < inputLength ? InBufLen : (int)inputLength);
#if CHECK_EOF
if( nRead == 0 )
return -1;
if (nRead == 0)
return -1;
#endif
inputLength -= nRead;
inputLength -= nRead;
inBufPos = DecBufLen;
inBufEnd = DecBufLen + nRead;
}
inBufPos = DecBufLen;
inBufEnd = DecBufLen + nRead;
}
return buf[inBufPos++];
}
return buf[inBufPos++];
}
private int ReadOffsetCore()
{
var buf = decodeBuffer;
private int ReadOffsetCore()
{
var buf = decodeBuffer;
if( inBufPos == inBufEnd )
{
int nRead = input.Read( buf, DecBufLen,
InBufLen < inputLength ? InBufLen : (int)inputLength );
if (inBufPos == inBufEnd)
{
int nRead = input.Read(buf, DecBufLen,
InBufLen < inputLength ? InBufLen : (int)inputLength);
#if CHECK_EOF
if( nRead == 0 )
return -1;
if (nRead == 0)
return -1;
#endif
inputLength -= nRead;
inputLength -= nRead;
inBufPos = DecBufLen;
inBufEnd = DecBufLen + nRead;
}
inBufPos = DecBufLen;
inBufEnd = DecBufLen + nRead;
}
if( inBufEnd - inBufPos == 1 )
{
buf[DecBufLen] = buf[inBufPos];
if (inBufEnd - inBufPos == 1)
{
buf[DecBufLen] = buf[inBufPos];
int nRead = input.Read( buf, DecBufLen + 1,
InBufLen - 1 < inputLength ? InBufLen - 1 : (int)inputLength );
int nRead = input.Read(buf, DecBufLen + 1,
InBufLen - 1 < inputLength ? InBufLen - 1 : (int)inputLength);
#if CHECK_EOF
if( nRead == 0 )
{
inBufPos = DecBufLen;
inBufEnd = DecBufLen + 1;
if (nRead == 0)
{
inBufPos = DecBufLen;
inBufEnd = DecBufLen + 1;
return -1;
}
return -1;
}
#endif
inputLength -= nRead;
inputLength -= nRead;
inBufPos = DecBufLen;
inBufEnd = DecBufLen + nRead + 1;
}
inBufPos = DecBufLen;
inBufEnd = DecBufLen + nRead + 1;
}
int ret = (buf[inBufPos + 1] << 8) | buf[inBufPos];
inBufPos += 2;
int ret = (buf[inBufPos + 1] << 8) | buf[inBufPos];
inBufPos += 2;
return ret;
}
return ret;
}
private int ReadCore( byte[] buffer, int offset, int count )
{
int nToRead = count;
private int ReadCore(byte[] buffer, int offset, int count)
{
int nToRead = count;
var buf = decodeBuffer;
int inBufLen = inBufEnd - inBufPos;
var buf = decodeBuffer;
int inBufLen = inBufEnd - inBufPos;
int fromBuf = nToRead < inBufLen ? nToRead : inBufLen;
if( fromBuf != 0 )
{
var bufPos = inBufPos;
int fromBuf = nToRead < inBufLen ? nToRead : inBufLen;
if (fromBuf != 0)
{
var bufPos = inBufPos;
for( int c = fromBuf; c-- != 0; )
buffer[offset++] = buf[bufPos++];
for (int c = fromBuf; c-- != 0;)
buffer[offset++] = buf[bufPos++];
inBufPos = bufPos;
nToRead -= fromBuf;
}
inBufPos = bufPos;
nToRead -= fromBuf;
}
if( nToRead != 0 )
{
int nRead;
if (nToRead != 0)
{
int nRead;
if( nToRead >= InBufLen )
{
nRead = input.Read( buffer, offset,
nToRead < inputLength ? nToRead : (int)inputLength );
nToRead -= nRead;
}
else
{
nRead = input.Read( buf, DecBufLen,
InBufLen < inputLength ? InBufLen : (int)inputLength );
if (nToRead >= InBufLen)
{
nRead = input.Read(buffer, offset,
nToRead < inputLength ? nToRead : (int)inputLength);
nToRead -= nRead;
}
else
{
nRead = input.Read(buf, DecBufLen,
InBufLen < inputLength ? InBufLen : (int)inputLength);
inBufPos = DecBufLen;
inBufEnd = DecBufLen + nRead;
inBufPos = DecBufLen;
inBufEnd = DecBufLen + nRead;
fromBuf = nToRead < nRead ? nToRead : nRead;
fromBuf = nToRead < nRead ? nToRead : nRead;
var bufPos = inBufPos;
var bufPos = inBufPos;
for( int c = fromBuf; c-- != 0; )
buffer[offset++] = buf[bufPos++];
for (int c = fromBuf; c-- != 0;)
buffer[offset++] = buf[bufPos++];
inBufPos = bufPos;
nToRead -= fromBuf;
}
inBufPos = bufPos;
nToRead -= fromBuf;
}
inputLength -= nRead;
}
inputLength -= nRead;
}
return count - nToRead;
}
return count - nToRead;
}
#region Stream internals
#region Stream internals
public override bool CanRead
{
get { return true; }
}
public override bool CanRead => true;
public override bool CanSeek
{
get { return false; }
}
public override bool CanSeek => false;
public override bool CanWrite
{
get { return false; }
}
public override bool CanWrite => false;
public override void Flush()
{
}
public override void Flush()
{
}
public override long Length
{
get { throw new NotSupportedException(); }
}
public override long Length
{
get { throw new NotSupportedException(); }
}
public override long Position
{
get { throw new NotSupportedException(); }
set { throw new NotSupportedException(); }
}
public override long Position
{
get { throw new NotSupportedException(); }
set { throw new NotSupportedException(); }
}
public override long Seek( long offset, SeekOrigin origin )
{
throw new NotSupportedException();
}
public override long Seek(long offset, SeekOrigin origin)
{
throw new NotSupportedException();
}
public override void SetLength( long value )
{
throw new NotSupportedException();
}
public override void SetLength(long value)
{
throw new NotSupportedException();
}
public override void Write( byte[] buffer, int offset, int count )
{
throw new NotSupportedException();
}
public override void Write(byte[] buffer, int offset, int count)
{
throw new NotSupportedException();
}
#endregion
}
#endregion
}
}

View File

@@ -130,35 +130,20 @@ namespace Unity_Studio
foreach (var memFile in b_File.MemoryAssetsFileList) //filter unity files
{
bool validAssetsFile = false;
switch (Path.GetExtension(memFile.fileName))
{
case ".assets":
case ".sharedAssets":
validAssetsFile = true;
break;
case "":
validAssetsFile = (memFile.fileName == "mainData" ||
Regex.IsMatch(memFile.fileName, "level.*?") ||
Regex.IsMatch(memFile.fileName, "CustomAssetBundle-.*?") ||
Regex.IsMatch(memFile.fileName, "CAB-.*?") ||
Regex.IsMatch(memFile.fileName, "BuildPlayer-.*?"));
break;
}
StatusStripUpdate("Loading " + memFile.fileName);
//create dummy path to be used for asset extraction
memFile.fileName = Path.GetDirectoryName(bundleFileName) + "\\" + memFile.fileName;
AssetsFile assetsFile = new AssetsFile(memFile.fileName, new EndianStream(memFile.memStream, EndianType.BigEndian));
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
assetsFile.m_Version = b_File.versionEngine;
assetsFile.version = Array.ConvertAll((b_File.versionEngine.Split(AssetsFile.strverSplit, StringSplitOptions.RemoveEmptyEntries)), int.Parse);
assetsFile.buildType = b_File.versionEngine.Split(AssetsFile.buildTypeSplit, StringSplitOptions.RemoveEmptyEntries);
}
if (validAssetsFile)
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
assetsFile.m_Version = b_File.versionEngine;
assetsFile.version = Array.ConvertAll((from Match m in Regex.Matches(assetsFile.m_Version, @"[0-9]") select m.Value).ToArray(), int.Parse);
assetsFile.buildType = b_File.versionEngine.Split(AssetsFile.buildTypeSplit, StringSplitOptions.RemoveEmptyEntries);
}
b_assetsfileList.Add(assetsFile);
}
assetsfileandstream[assetsFile.fileName] = assetsFile.a_Stream;
@@ -239,7 +224,7 @@ namespace Unity_Studio
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
if (loadAssetsMenuItem)
@@ -254,7 +239,7 @@ namespace Unity_Studio
StatusStripUpdate("Building asset list from " + Path.GetFileName(assetsFile.filePath));
string fileID = i.ToString(fileIDfmt);
AssetBundle ab = null;
foreach (var asset in assetsFile.preloadTable.Values)
{
asset.uniqueID = fileID + asset.uniqueID;
@@ -280,7 +265,6 @@ namespace Unity_Studio
assetsFile.TransformList.Add(asset.m_PathID, m_Rect.m_Transform);
break;
}
//case 21: //Material
case 28: //Texture2D
{
Texture2D m_Texture2D = new Texture2D(asset, false);
@@ -324,8 +308,18 @@ namespace Unity_Studio
productName = plSet.productName;
break;
}
case 21: //Material
case 43: //Mesh
{
Mesh m_Mesh = new Mesh(asset, false);
exportable = true;
break;
}
case 142: //AssetBundle
{
ab = new AssetBundle(asset);
break;
}
case 21: //Material
case 74: //AnimationClip
case 90: //Avatar
case 91: //AnimatorController
@@ -360,10 +354,23 @@ namespace Unity_Studio
{
asset.Text += " #" + asset.uniqueID;
}
asset.Text = FixFileName(asset.Text);
assetsFile.exportableAssets.Add(asset);
}
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))
{
var ex = Path.GetExtension(replacename);
x.Text = !string.IsNullOrEmpty(ex) ? replacename.Replace(ex, "") : replacename;
}
});
}
exportableAssets.AddRange(assetsFile.exportableAssets);
//if (assetGroup.Items.Count > 0) { listView1.Groups.Add(assetGroup); }
}
@@ -380,6 +387,7 @@ namespace Unity_Studio
fileNodes = new List<GameObject>();
if (buildHierarchyMenuItem)
{
SetProgressBarMaximum(1);
SetProgressBarValue(1);
SetProgressBarMaximum(assetsfileList.Sum(x => x.GameObjectList.Values.Count) + 1);
foreach (var assetsFile in assetsfileList)
@@ -919,7 +927,7 @@ namespace Unity_Studio
//StatusStripUpdate("Writing Geometry");
foreach (var MeshPD in Meshes)
{
Mesh m_Mesh = new Mesh(MeshPD);
Mesh m_Mesh = new Mesh(MeshPD, true);
MeshFBX(m_Mesh, MeshPD.uniqueID, ob);
//write data 8MB at a time
@@ -950,7 +958,7 @@ namespace Unity_Studio
//find a way to test if a mesh instance was loaded previously and if it uses the same skeleton, then create instance or copy
var keepID = MeshPD.uniqueID;
MeshPD.uniqueID = SkinnedMeshPD.uniqueID;
Mesh m_Mesh = new Mesh(MeshPD);
Mesh m_Mesh = new Mesh(MeshPD, true);
MeshFBX(m_Mesh, MeshPD.uniqueID, ob);
//write data 8MB at a time
@@ -1084,10 +1092,6 @@ namespace Unity_Studio
}
}
}
else
{
//bool stop = true;
}
}
MeshPD.uniqueID = keepID;
@@ -1120,7 +1124,7 @@ namespace Unity_Studio
//TODO check texture type and set path accordingly; eg. CubeMap, Texture3D
string texPathName = Path.GetDirectoryName(FBXfile) + "\\Texture2D\\";
ExportTexture(TexturePD, texPathName, false);
texPathName += TexturePD.Text + ".png";//必须是png文件
texPathName = Path.GetFullPath(Path.Combine(texPathName, $"{TexturePD.Text}.png"));//必须是png文件
ob.AppendFormat("\n\tTexture: 7{0}, \"Texture::{1}\", \"\" {{", TexturePD.uniqueID, TexturePD.Text);
ob.Append("\n\t\tType: \"TextureVideoClip\"");
ob.Append("\n\t\tVersion: 202");
@@ -1131,7 +1135,7 @@ namespace Unity_Studio
ob.Append("\n\t\t}");
ob.AppendFormat("\n\t\tMedia: \"Video::{0}\"", TexturePD.Text);
ob.AppendFormat("\n\t\tFileName: \"{0}\"", texPathName);
ob.AppendFormat("\n\t\tRelativeFilename: \"Texture2D\\{0}\"", Path.GetFileName(texPathName));
ob.AppendFormat("\n\t\tRelativeFilename: \"{0}\"", texPathName.Replace($"{Path.GetDirectoryName(FBXfile)}\\", ""));
ob.Append("\n\t}");
ob.AppendFormat("\n\tVideo: 8{0}, \"Video::{1}\", \"Clip\" {{", TexturePD.uniqueID, TexturePD.Text);
@@ -1140,7 +1144,7 @@ namespace Unity_Studio
ob.AppendFormat("\n\t\t\tP: \"Path\", \"KString\", \"XRefUrl\", \"\", \"{0}\"", texPathName);
ob.Append("\n\t\t}");
ob.AppendFormat("\n\t\tFileName: \"{0}\"", texPathName);
ob.AppendFormat("\n\t\tRelativeFilename: \"Texture2D\\{0}\"", Path.GetFileName(texPathName));
ob.AppendFormat("\n\t\tRelativeFilename: \"{0}\"", texPathName.Replace($"{Path.GetDirectoryName(FBXfile)}\\", ""));
ob.Append("\n\t}");
//connect video to texture
@@ -1287,16 +1291,29 @@ namespace Unity_Studio
//ob.Append(string.Join(",", m_Mesh.m_Colors));
lineSplit = ob.Length;
for (int i = 0; i < m_Mesh.m_VertexCount; i++)
if (m_Mesh.m_Colors.Length == m_Mesh.m_VertexCount * 3)
{
ob.AppendFormat("{0},{1},{2},{3},", m_Mesh.m_Colors[i * 2], m_Mesh.m_Colors[i * 2 + 1], m_Mesh.m_Colors[i * 2 + 2], m_Mesh.m_Colors[i * 2 + 3]);
if (ob.Length - lineSplit > 2000)
for (int i = 0; i < m_Mesh.m_VertexCount; i++)
{
ob.Append("\n");
lineSplit = ob.Length;
ob.AppendFormat("{0},{1},{2},{3},", m_Mesh.m_Colors[i * 3], m_Mesh.m_Colors[i * 3 + 1], m_Mesh.m_Colors[i * 3 + 2], 1.0f);
if (ob.Length - lineSplit > 2000)
{
ob.Append("\n");
lineSplit = ob.Length;
}
}
}
else
{
for (int i = 0; i < m_Mesh.m_VertexCount; i++)
{
ob.AppendFormat("{0},{1},{2},{3},", m_Mesh.m_Colors[i * 4], m_Mesh.m_Colors[i * 4 + 1], m_Mesh.m_Colors[i * 4 + 2], m_Mesh.m_Colors[i * 4 + 3]);
if (ob.Length - lineSplit > 2000)
{
ob.Append("\n");
lineSplit = ob.Length;
}
}
}
ob.Length--;//remove last comma
@@ -1632,7 +1649,8 @@ namespace Unity_Studio
public static bool ExportAudioClip(AssetPreloadData asset, string exportFilename, string exportFileextension)
{
var oldextension = exportFileextension;
if ((bool)Properties.Settings.Default["convertfsb"] && exportFileextension == ".fsb")
var convertfsb = (bool)Properties.Settings.Default["convertfsb"];
if (convertfsb && exportFileextension == ".fsb")
{
exportFileextension = ".wav";
}
@@ -1640,7 +1658,7 @@ namespace Unity_Studio
if (ExportFileExists(exportFullname))
return false;
var m_AudioClip = new AudioClip(asset, true);
if ((bool)Properties.Settings.Default["convertfsb"] && oldextension == ".fsb")
if (convertfsb && oldextension == ".fsb")
{
FMOD.System system;
FMOD.Sound sound;
@@ -1733,6 +1751,67 @@ namespace Unity_Studio
}
}
public static void ExportMesh(Mesh m_Mesh, string exportPath)
{
var sb = new StringBuilder();
sb.AppendLine("g " + m_Mesh.m_Name);
#region Vertices
int c = 3;
if (m_Mesh.m_Vertices.Length == m_Mesh.m_VertexCount * 4)
{
c = 4;
}
for (int v = 0; v < m_Mesh.m_VertexCount; v++)
{
sb.AppendFormat("v {0} {1} {2}\r\n", -m_Mesh.m_Vertices[v * c], m_Mesh.m_Vertices[v * c + 1], m_Mesh.m_Vertices[v * c + 2]);
}
#endregion
#region UV
if (m_Mesh.m_UV1 != null && m_Mesh.m_UV1.Length == m_Mesh.m_VertexCount * 2)
{
for (int v = 0; v < m_Mesh.m_VertexCount; v++)
{
sb.AppendFormat("vt {0} {1}\r\n", m_Mesh.m_UV1[v * 2], m_Mesh.m_UV1[v * 2 + 1]);
}
}
else if (m_Mesh.m_UV2 != null && m_Mesh.m_UV2.Length == m_Mesh.m_VertexCount * 2)
{
for (int v = 0; v < m_Mesh.m_VertexCount; v++)
{
sb.AppendFormat("vt {0} {1}\r\n", m_Mesh.m_UV2[v * 2], m_Mesh.m_UV2[v * 2 + 1]);
}
}
#endregion
#region Normals
if (m_Mesh.m_Normals != null && m_Mesh.m_Normals.Length > 0)
{
if (m_Mesh.m_Normals.Length == m_Mesh.m_VertexCount * 3)
{
c = 3;
}
else if (m_Mesh.m_Normals.Length == m_Mesh.m_VertexCount * 4)
{
c = 4;
}
for (int v = 0; v < m_Mesh.m_VertexCount; v++)
{
sb.AppendFormat("vn {0} {1} {2}\r\n", -m_Mesh.m_Normals[v * c], m_Mesh.m_Normals[v * c + 1], m_Mesh.m_Normals[v * c + 2]);
}
}
#endregion
#region Face
for (int f = 0; f < m_Mesh.m_Indices.Count / 3; f++)
{
sb.AppendFormat("f {0}/{0}/{0} {1}/{1}/{1} {2}/{2}/{2}\r\n", m_Mesh.m_Indices[f * 3 + 2] + 1, m_Mesh.m_Indices[f * 3 + 1] + 1, m_Mesh.m_Indices[f * 3] + 1);
}
#endregion
File.WriteAllText(exportPath, sb.ToString());
}
public static bool ExportFileExists(string filename)
{
if (File.Exists(filename))
@@ -1742,5 +1821,11 @@ namespace Unity_Studio
Directory.CreateDirectory(Path.GetDirectoryName(filename));
return false;
}
private static string FixFileName(string str)
{
if (str.Length >= 260) return Path.GetRandomFileName();
return Path.GetInvalidFileNameChars().Aggregate(str, (current, c) => current.Replace(c, '_'));
}
}
}

View File

@@ -0,0 +1,269 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F5E07FB2-95E4-417F-943F-D439D9A03BBA}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Unity_Studio</RootNamespace>
<AssemblyName>Unity Studio</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resources\unity.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>library\OpenTK.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenTK.GLControl, Version=1.1.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>library\OpenTK.GLControl.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Half, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>library\System.Half.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="7zip\Common\CommandLineParser.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="7zip\Common\CRC.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="7zip\Common\InBuffer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="7zip\Common\OutBuffer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="7zip\Compress\LZMA\LzmaBase.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="7zip\Compress\LZMA\LzmaDecoder.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="7zip\Compress\LZMA\LzmaEncoder.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="7zip\Compress\LZ\IMatchFinder.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="7zip\Compress\LZ\LzBinTree.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="7zip\Compress\LZ\LzInWindow.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="7zip\Compress\LZ\LzOutWindow.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="7zip\Compress\RangeCoder\RangeCoder.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="7zip\Compress\RangeCoder\RangeCoderBit.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="7zip\Compress\RangeCoder\RangeCoderBitTree.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="7zip\ICoder.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="7zip\SevenZipHelper.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="AboutBox.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AboutBox.Designer.cs">
<DependentUpon>AboutBox.cs</DependentUpon>
</Compile>
<Compile Include="Resource1.Designer.cs">
<DependentUpon>Resource1.resx</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="ShaderResource.Designer.cs">
<DependentUpon>ShaderResource.resx</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Unity Classes\AssetBundle.cs" />
<Compile Include="Unity Studio Classes\AssetPreloadData.cs" />
<Compile Include="Unity Classes\AudioClip.cs" />
<Compile Include="Unity Classes\BuildSettings.cs" />
<Compile Include="Unity Studio Classes\BundleFile.cs" />
<Compile Include="Unity Studio Classes\UnityStudio.cs" />
<Compile Include="Unity Studio Classes\ClassIDReference.cs" />
<Compile Include="Unity Studio Classes\EndianStream.cs" />
<Compile Include="ExportOptions.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ExportOptions.Designer.cs">
<DependentUpon>ExportOptions.cs</DependentUpon>
</Compile>
<Compile Include="FMOD Studio API\fmod.cs" />
<Compile Include="FMOD Studio API\fmod_dsp.cs" />
<Compile Include="FMOD Studio API\fmod_errors.cs" />
<Compile Include="Unity Classes\Font.cs" />
<Compile Include="GOHierarchy.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Unity Studio Classes\Lz4DecoderStream.cs" />
<Compile Include="Unity Classes\Material.cs" />
<Compile Include="Unity Classes\Mesh.cs" />
<Compile Include="Unity Classes\GameObject.cs" />
<Compile Include="Unity Studio Classes\helpers.cs" />
<Compile Include="Unity Classes\MonoBehaviour.cs" />
<Compile Include="Unity Classes\PlayerSettings.cs" />
<Compile Include="Unity Classes\RectTransform.cs" />
<Compile Include="Unity Classes\MeshRenderer.cs" />
<Compile Include="Unity Classes\Shader.cs" />
<Compile Include="Unity Classes\SkinnedMeshRenderer.cs" />
<Compile Include="Unity Classes\MeshFilter.cs" />
<Compile Include="Unity Classes\TextAsset.cs" />
<Compile Include="Unity Classes\Texture2D.cs" />
<Compile Include="Unity Classes\Transform.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Unity Studio Classes\AssetsFile.cs" />
<Compile Include="UnityStudioForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UnityStudioForm.Designer.cs">
<DependentUpon>UnityStudioForm.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="AboutBox.resx">
<DependentUpon>AboutBox.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="ExportOptions.resx">
<DependentUpon>ExportOptions.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="Resource1.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resource1.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="ShaderResource.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>ShaderResource.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="UnityStudioForm.resx">
<DependentUpon>UnityStudioForm.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.4.5">
<Visible>False</Visible>
<ProductName>Windows Installer 4.5</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="Resources\unity.ico" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\preview.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy /y "$(ProjectDir)library" "$(TargetDir)"
xcopy /y "$(ProjectDir)library\$(PlatformName)" "$(TargetDir)"</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@@ -14,6 +14,7 @@
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
@@ -26,31 +27,9 @@
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resources\unity.ico</ApplicationIcon>
</PropertyGroup>
@@ -72,19 +51,32 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Reference Include="OpenTK, Version=2.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>library\OpenTK.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenTK.GLControl, Version=1.1.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>library\OpenTK.GLControl.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Half, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>library\System.Half.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
@@ -144,6 +136,17 @@
<Compile Include="AboutBox.Designer.cs">
<DependentUpon>AboutBox.cs</DependentUpon>
</Compile>
<Compile Include="Resource1.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resource1.resx</DependentUpon>
</Compile>
<Compile Include="ShaderResource.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>ShaderResource.resx</DependentUpon>
</Compile>
<Compile Include="Unity Classes\AssetBundle.cs" />
<Compile Include="Unity Studio Classes\AssetPreloadData.cs" />
<Compile Include="Unity Classes\AudioClip.cs" />
<Compile Include="Unity Classes\BuildSettings.cs" />
@@ -205,6 +208,14 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="Resource1.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resource1.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="ShaderResource.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>ShaderResource.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="UnityStudioForm.resx">
<DependentUpon>UnityStudioForm.cs</DependentUpon>
<SubType>Designer</SubType>

View File

@@ -45,6 +45,7 @@
this.exportClassStructuresMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.optionsToolStripMenuItem = 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.displayInfo = new System.Windows.Forms.ToolStripMenuItem();
this.openAfterExport = new System.Windows.Forms.ToolStripMenuItem();
@@ -52,6 +53,7 @@
this.showExpOpt = new System.Windows.Forms.ToolStripMenuItem();
this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportAll3DMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.all3DObjectssplitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportSelected3DMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.exportAllAssetsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -62,7 +64,7 @@
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.sceneTreeView = new Unity_Studio.GOHierarchy();
this.sceneTreeView = new GOHierarchy();
this.treeSearch = new System.Windows.Forms.TextBox();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.assetListView = new System.Windows.Forms.ListView();
@@ -87,6 +89,7 @@
this.FMODplayButton = new System.Windows.Forms.Button();
this.fontPreviewBox = new System.Windows.Forms.RichTextBox();
this.textPreviewBox = new System.Windows.Forms.TextBox();
this.glControl1 = new OpenTK.GLControl();
this.classPreviewPanel = new System.Windows.Forms.Panel();
this.classTextBox = new System.Windows.Forms.TextBox();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
@@ -96,12 +99,14 @@
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.timer = new System.Windows.Forms.Timer(this.components);
this.timerOpenTK = new System.Windows.Forms.Timer(this.components);
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.openFolderDialog1 = new System.Windows.Forms.OpenFileDialog();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.saveFolderDialog1 = new System.Windows.Forms.SaveFileDialog();
this.treeTip = new System.Windows.Forms.ToolTip(this.components);
this.all3DObjectssplitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.showOriginalFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
@@ -111,6 +116,7 @@
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.progressbarPanel.SuspendLayout();
this.glControl1.SuspendLayout();
this.previewPanel.SuspendLayout();
this.FMODpanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.FMODprogressBar)).BeginInit();
@@ -118,6 +124,7 @@
this.classPreviewPanel.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.tabPage3.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// menuStrip1
@@ -130,7 +137,7 @@
this.helpToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(1264, 25);
this.menuStrip1.Size = new System.Drawing.Size(1264, 24);
this.menuStrip1.TabIndex = 0;
this.menuStrip1.Text = "menuStrip1";
//
@@ -143,39 +150,39 @@
this.extractBundleToolStripMenuItem,
this.extractFolderToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(39, 21);
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.fileToolStripMenuItem.Text = "File";
//
// loadFileToolStripMenuItem
//
this.loadFileToolStripMenuItem.Name = "loadFileToolStripMenuItem";
this.loadFileToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
this.loadFileToolStripMenuItem.Size = new System.Drawing.Size(158, 22);
this.loadFileToolStripMenuItem.Text = "Load file...";
this.loadFileToolStripMenuItem.Click += new System.EventHandler(this.loadFile_Click);
//
// loadFolderToolStripMenuItem
//
this.loadFolderToolStripMenuItem.Name = "loadFolderToolStripMenuItem";
this.loadFolderToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
this.loadFolderToolStripMenuItem.Size = new System.Drawing.Size(158, 22);
this.loadFolderToolStripMenuItem.Text = "Load folder...";
this.loadFolderToolStripMenuItem.Click += new System.EventHandler(this.loadFolder_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(165, 6);
this.toolStripMenuItem1.Size = new System.Drawing.Size(155, 6);
//
// extractBundleToolStripMenuItem
//
this.extractBundleToolStripMenuItem.Name = "extractBundleToolStripMenuItem";
this.extractBundleToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
this.extractBundleToolStripMenuItem.Size = new System.Drawing.Size(158, 22);
this.extractBundleToolStripMenuItem.Text = "Extract bundle...";
this.extractBundleToolStripMenuItem.Click += new System.EventHandler(this.extractBundleToolStripMenuItem_Click);
//
// extractFolderToolStripMenuItem
//
this.extractFolderToolStripMenuItem.Name = "extractFolderToolStripMenuItem";
this.extractFolderToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
this.extractFolderToolStripMenuItem.Size = new System.Drawing.Size(158, 22);
this.extractFolderToolStripMenuItem.Text = "Extract folder...";
this.extractFolderToolStripMenuItem.Click += new System.EventHandler(this.extractFolderToolStripMenuItem_Click);
//
@@ -188,7 +195,7 @@
this.toolStripSeparator2,
this.exportClassStructuresMenuItem});
this.debugMenuItem.Name = "debugMenuItem";
this.debugMenuItem.Size = new System.Drawing.Size(87, 21);
this.debugMenuItem.Size = new System.Drawing.Size(80, 20);
this.debugMenuItem.Text = "Diagnostics";
this.debugMenuItem.Visible = false;
//
@@ -196,14 +203,14 @@
//
this.buildClassStructuresMenuItem.CheckOnClick = true;
this.buildClassStructuresMenuItem.Name = "buildClassStructuresMenuItem";
this.buildClassStructuresMenuItem.Size = new System.Drawing.Size(224, 22);
this.buildClassStructuresMenuItem.Size = new System.Drawing.Size(208, 22);
this.buildClassStructuresMenuItem.Text = "Build class structures";
//
// dontLoadAssetsMenuItem
//
this.dontLoadAssetsMenuItem.CheckOnClick = true;
this.dontLoadAssetsMenuItem.Name = "dontLoadAssetsMenuItem";
this.dontLoadAssetsMenuItem.Size = new System.Drawing.Size(224, 22);
this.dontLoadAssetsMenuItem.Size = new System.Drawing.Size(208, 22);
this.dontLoadAssetsMenuItem.Text = "Don\'t load assets";
this.dontLoadAssetsMenuItem.CheckedChanged += new System.EventHandler(this.dontLoadAssetsMenuItem_CheckedChanged);
//
@@ -211,18 +218,18 @@
//
this.dontBuildHierarchyMenuItem.CheckOnClick = true;
this.dontBuildHierarchyMenuItem.Name = "dontBuildHierarchyMenuItem";
this.dontBuildHierarchyMenuItem.Size = new System.Drawing.Size(224, 22);
this.dontBuildHierarchyMenuItem.Size = new System.Drawing.Size(208, 22);
this.dontBuildHierarchyMenuItem.Text = "Don\'t build hierarchy tree";
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(221, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(205, 6);
//
// exportClassStructuresMenuItem
//
this.exportClassStructuresMenuItem.Name = "exportClassStructuresMenuItem";
this.exportClassStructuresMenuItem.Size = new System.Drawing.Size(224, 22);
this.exportClassStructuresMenuItem.Size = new System.Drawing.Size(208, 22);
this.exportClassStructuresMenuItem.Text = "Export class structures";
this.exportClassStructuresMenuItem.Click += new System.EventHandler(this.exportClassStructuresMenuItem_Click);
//
@@ -230,15 +237,25 @@
//
this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.displayAll,
this.displayOriginalName,
this.enablePreview,
this.displayInfo,
this.openAfterExport,
this.assetGroupOptions,
this.showExpOpt});
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(66, 21);
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20);
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
//
this.displayAll.CheckOnClick = true;
@@ -290,7 +307,7 @@
"Group exported assets by source file",
"Do not group exported assets"});
this.assetGroupOptions.Name = "assetGroupOptions";
this.assetGroupOptions.Size = new System.Drawing.Size(192, 25);
this.assetGroupOptions.Size = new System.Drawing.Size(192, 23);
this.assetGroupOptions.SelectedIndexChanged += new System.EventHandler(this.assetGroupOptions_SelectedIndexChanged);
//
// showExpOpt
@@ -311,46 +328,53 @@
this.exportSelectedAssetsMenuItem,
this.exportFilteredAssetsMenuItem});
this.exportToolStripMenuItem.Name = "exportToolStripMenuItem";
this.exportToolStripMenuItem.Size = new System.Drawing.Size(58, 21);
this.exportToolStripMenuItem.Size = new System.Drawing.Size(52, 20);
this.exportToolStripMenuItem.Text = "Export";
//
// exportAll3DMenuItem
//
this.exportAll3DMenuItem.Name = "exportAll3DMenuItem";
this.exportAll3DMenuItem.Size = new System.Drawing.Size(192, 22);
this.exportAll3DMenuItem.Size = new System.Drawing.Size(179, 22);
this.exportAll3DMenuItem.Text = "All 3D objects";
this.exportAll3DMenuItem.Click += new System.EventHandler(this.Export3DObjects_Click);
//
// all3DObjectssplitToolStripMenuItem
//
this.all3DObjectssplitToolStripMenuItem.Name = "all3DObjectssplitToolStripMenuItem";
this.all3DObjectssplitToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
this.all3DObjectssplitToolStripMenuItem.Text = "All 3D objects (split)";
this.all3DObjectssplitToolStripMenuItem.Click += new System.EventHandler(this.all3DObjectssplitToolStripMenuItem_Click);
//
// exportSelected3DMenuItem
//
this.exportSelected3DMenuItem.Name = "exportSelected3DMenuItem";
this.exportSelected3DMenuItem.Size = new System.Drawing.Size(192, 22);
this.exportSelected3DMenuItem.Size = new System.Drawing.Size(179, 22);
this.exportSelected3DMenuItem.Text = "Selected 3D objects";
this.exportSelected3DMenuItem.Click += new System.EventHandler(this.Export3DObjects_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(189, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(176, 6);
//
// exportAllAssetsMenuItem
//
this.exportAllAssetsMenuItem.Name = "exportAllAssetsMenuItem";
this.exportAllAssetsMenuItem.Size = new System.Drawing.Size(192, 22);
this.exportAllAssetsMenuItem.Size = new System.Drawing.Size(179, 22);
this.exportAllAssetsMenuItem.Text = "All assets";
this.exportAllAssetsMenuItem.Click += new System.EventHandler(this.ExportAssets_Click);
//
// exportSelectedAssetsMenuItem
//
this.exportSelectedAssetsMenuItem.Name = "exportSelectedAssetsMenuItem";
this.exportSelectedAssetsMenuItem.Size = new System.Drawing.Size(192, 22);
this.exportSelectedAssetsMenuItem.Size = new System.Drawing.Size(179, 22);
this.exportSelectedAssetsMenuItem.Text = "Selected assets";
this.exportSelectedAssetsMenuItem.Click += new System.EventHandler(this.ExportAssets_Click);
//
// exportFilteredAssetsMenuItem
//
this.exportFilteredAssetsMenuItem.Name = "exportFilteredAssetsMenuItem";
this.exportFilteredAssetsMenuItem.Size = new System.Drawing.Size(192, 22);
this.exportFilteredAssetsMenuItem.Size = new System.Drawing.Size(179, 22);
this.exportFilteredAssetsMenuItem.Text = "Filtered assets";
this.exportFilteredAssetsMenuItem.Click += new System.EventHandler(this.ExportAssets_Click);
//
@@ -359,13 +383,13 @@
this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.aboutToolStripMenuItem});
this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
this.helpToolStripMenuItem.Size = new System.Drawing.Size(47, 21);
this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
this.helpToolStripMenuItem.Text = "Help";
//
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(111, 22);
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(107, 22);
this.aboutToolStripMenuItem.Text = "About";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
//
@@ -373,7 +397,7 @@
//
this.splitContainer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 25);
this.splitContainer1.Location = new System.Drawing.Point(0, 24);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
@@ -388,7 +412,7 @@
this.splitContainer1.Panel2.Controls.Add(this.classPreviewPanel);
this.splitContainer1.Panel2.Controls.Add(this.statusStrip1);
this.splitContainer1.Panel2MinSize = 400;
this.splitContainer1.Size = new System.Drawing.Size(1264, 605);
this.splitContainer1.Size = new System.Drawing.Size(1264, 659);
this.splitContainer1.SplitterDistance = 420;
this.splitContainer1.TabIndex = 2;
this.splitContainer1.TabStop = false;
@@ -402,7 +426,7 @@
this.tabControl1.Name = "tabControl1";
this.tabControl1.Padding = new System.Drawing.Point(17, 3);
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(418, 583);
this.tabControl1.Size = new System.Drawing.Size(418, 635);
this.tabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
this.tabControl1.TabIndex = 0;
this.tabControl1.Selected += new System.Windows.Forms.TabControlEventHandler(this.tabPageSelected);
@@ -435,7 +459,7 @@
this.treeSearch.ForeColor = System.Drawing.SystemColors.GrayText;
this.treeSearch.Location = new System.Drawing.Point(0, 0);
this.treeSearch.Name = "treeSearch";
this.treeSearch.Size = new System.Drawing.Size(410, 21);
this.treeSearch.Size = new System.Drawing.Size(410, 20);
this.treeSearch.TabIndex = 0;
this.treeSearch.Text = " Search ";
this.treeSearch.TextChanged += new System.EventHandler(this.treeSearch_TextChanged);
@@ -450,7 +474,7 @@
this.tabPage2.Controls.Add(this.listSearch);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Size = new System.Drawing.Size(410, 557);
this.tabPage2.Size = new System.Drawing.Size(410, 609);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Asset List";
this.tabPage2.UseVisualStyleBackColor = true;
@@ -467,9 +491,9 @@
this.assetListView.GridLines = true;
this.assetListView.HideSelection = false;
this.assetListView.LabelEdit = true;
this.assetListView.Location = new System.Drawing.Point(0, 21);
this.assetListView.Location = new System.Drawing.Point(0, 20);
this.assetListView.Name = "assetListView";
this.assetListView.Size = new System.Drawing.Size(410, 536);
this.assetListView.Size = new System.Drawing.Size(410, 589);
this.assetListView.TabIndex = 1;
this.assetListView.UseCompatibleStateImageBehavior = false;
this.assetListView.View = System.Windows.Forms.View.Details;
@@ -477,6 +501,7 @@
this.assetListView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.assetListView_ColumnClick);
this.assetListView.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.selectAsset);
this.assetListView.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.assetListView_RetrieveVirtualItem);
this.assetListView.MouseClick += new System.Windows.Forms.MouseEventHandler(this.assetListView_MouseClick);
//
// columnHeaderName
//
@@ -499,7 +524,7 @@
this.listSearch.ForeColor = System.Drawing.SystemColors.GrayText;
this.listSearch.Location = new System.Drawing.Point(0, 0);
this.listSearch.Name = "listSearch";
this.listSearch.Size = new System.Drawing.Size(410, 21);
this.listSearch.Size = new System.Drawing.Size(410, 20);
this.listSearch.TabIndex = 0;
this.listSearch.Text = " Filter ";
this.listSearch.TextChanged += new System.EventHandler(this.ListSearchTextChanged);
@@ -510,10 +535,10 @@
//
this.progressbarPanel.Controls.Add(this.progressBar1);
this.progressbarPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
this.progressbarPanel.Location = new System.Drawing.Point(0, 583);
this.progressbarPanel.Location = new System.Drawing.Point(0, 635);
this.progressbarPanel.Name = "progressbarPanel";
this.progressbarPanel.Padding = new System.Windows.Forms.Padding(1, 3, 1, 1);
this.progressbarPanel.Size = new System.Drawing.Size(418, 20);
this.progressbarPanel.Size = new System.Drawing.Size(418, 22);
this.progressbarPanel.TabIndex = 2;
//
// progressBar1
@@ -521,23 +546,24 @@
this.progressBar1.Dock = System.Windows.Forms.DockStyle.Fill;
this.progressBar1.Location = new System.Drawing.Point(1, 3);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(416, 16);
this.progressBar1.Size = new System.Drawing.Size(416, 18);
this.progressBar1.Step = 1;
this.progressBar1.TabIndex = 1;
//
// previewPanel
//
this.previewPanel.BackColor = System.Drawing.SystemColors.ControlDark;
this.previewPanel.BackgroundImage = Properties.Resources.preview;
this.previewPanel.BackgroundImage = global::Unity_Studio.Properties.Resources.preview;
this.previewPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.previewPanel.Controls.Add(this.assetInfoLabel);
this.previewPanel.Controls.Add(this.FMODpanel);
this.previewPanel.Controls.Add(this.fontPreviewBox);
this.previewPanel.Controls.Add(this.textPreviewBox);
this.previewPanel.Controls.Add(this.glControl1);
this.previewPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.previewPanel.Location = new System.Drawing.Point(0, 0);
this.previewPanel.Name = "previewPanel";
this.previewPanel.Size = new System.Drawing.Size(838, 581);
this.previewPanel.Size = new System.Drawing.Size(838, 635);
this.previewPanel.TabIndex = 1;
//
// assetInfoLabel
@@ -545,9 +571,9 @@
this.assetInfoLabel.AutoSize = true;
this.assetInfoLabel.BackColor = System.Drawing.Color.Transparent;
this.assetInfoLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.assetInfoLabel.Location = new System.Drawing.Point(4, 7);
this.assetInfoLabel.Location = new System.Drawing.Point(4, 8);
this.assetInfoLabel.Name = "assetInfoLabel";
this.assetInfoLabel.Size = new System.Drawing.Size(0, 12);
this.assetInfoLabel.Size = new System.Drawing.Size(0, 13);
this.assetInfoLabel.TabIndex = 0;
//
// FMODpanel
@@ -564,9 +590,9 @@
this.FMODpanel.Controls.Add(this.FMODstopButton);
this.FMODpanel.Controls.Add(this.FMODpauseButton);
this.FMODpanel.Controls.Add(this.FMODplayButton);
this.FMODpanel.Location = new System.Drawing.Point(220, 191);
this.FMODpanel.Location = new System.Drawing.Point(0, 0);
this.FMODpanel.Name = "FMODpanel";
this.FMODpanel.Size = new System.Drawing.Size(400, 185);
this.FMODpanel.Size = new System.Drawing.Size(838, 635);
this.FMODpanel.TabIndex = 2;
this.FMODpanel.Visible = false;
//
@@ -574,26 +600,26 @@
//
this.FMODcopyright.AutoSize = true;
this.FMODcopyright.ForeColor = System.Drawing.SystemColors.ControlLight;
this.FMODcopyright.Location = new System.Drawing.Point(117, 173);
this.FMODcopyright.Location = new System.Drawing.Point(249, 380);
this.FMODcopyright.Name = "FMODcopyright";
this.FMODcopyright.Size = new System.Drawing.Size(341, 12);
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
//
this.FMODinfoLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.FMODinfoLabel.Location = new System.Drawing.Point(82, 50);
this.FMODinfoLabel.Location = new System.Drawing.Point(305, 271);
this.FMODinfoLabel.Name = "FMODinfoLabel";
this.FMODinfoLabel.Size = new System.Drawing.Size(176, 12);
this.FMODinfoLabel.Size = new System.Drawing.Size(176, 13);
this.FMODinfoLabel.TabIndex = 8;
//
// FMODtimerLabel
//
this.FMODtimerLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.FMODtimerLabel.Location = new System.Drawing.Point(212, 50);
this.FMODtimerLabel.Location = new System.Drawing.Point(435, 271);
this.FMODtimerLabel.Name = "FMODtimerLabel";
this.FMODtimerLabel.Size = new System.Drawing.Size(158, 12);
this.FMODtimerLabel.Size = new System.Drawing.Size(158, 13);
this.FMODtimerLabel.TabIndex = 7;
this.FMODtimerLabel.Text = "0:00.0 / 0:00.0";
this.FMODtimerLabel.TextAlign = System.Drawing.ContentAlignment.TopRight;
@@ -601,19 +627,19 @@
// FMODstatusLabel
//
this.FMODstatusLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.FMODstatusLabel.Location = new System.Drawing.Point(26, 50);
this.FMODstatusLabel.Location = new System.Drawing.Point(249, 271);
this.FMODstatusLabel.Name = "FMODstatusLabel";
this.FMODstatusLabel.Size = new System.Drawing.Size(50, 12);
this.FMODstatusLabel.Size = new System.Drawing.Size(50, 13);
this.FMODstatusLabel.TabIndex = 6;
this.FMODstatusLabel.Text = "Stopped";
//
// FMODprogressBar
//
this.FMODprogressBar.AutoSize = false;
this.FMODprogressBar.Location = new System.Drawing.Point(29, 67);
this.FMODprogressBar.Location = new System.Drawing.Point(252, 290);
this.FMODprogressBar.Maximum = 1000;
this.FMODprogressBar.Name = "FMODprogressBar";
this.FMODprogressBar.Size = new System.Drawing.Size(348, 22);
this.FMODprogressBar.Size = new System.Drawing.Size(348, 24);
this.FMODprogressBar.TabIndex = 5;
this.FMODprogressBar.TickStyle = System.Windows.Forms.TickStyle.None;
this.FMODprogressBar.Scroll += new System.EventHandler(this.FMODprogressBar_Scroll);
@@ -623,7 +649,7 @@
// FMODvolumeBar
//
this.FMODvolumeBar.LargeChange = 2;
this.FMODvolumeBar.Location = new System.Drawing.Point(273, 95);
this.FMODvolumeBar.Location = new System.Drawing.Point(496, 320);
this.FMODvolumeBar.Name = "FMODvolumeBar";
this.FMODvolumeBar.Size = new System.Drawing.Size(104, 45);
this.FMODvolumeBar.TabIndex = 4;
@@ -634,9 +660,9 @@
// FMODloopButton
//
this.FMODloopButton.Appearance = System.Windows.Forms.Appearance.Button;
this.FMODloopButton.Location = new System.Drawing.Point(212, 95);
this.FMODloopButton.Location = new System.Drawing.Point(435, 320);
this.FMODloopButton.Name = "FMODloopButton";
this.FMODloopButton.Size = new System.Drawing.Size(55, 42);
this.FMODloopButton.Size = new System.Drawing.Size(55, 46);
this.FMODloopButton.TabIndex = 3;
this.FMODloopButton.Text = "Loop";
this.FMODloopButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@@ -645,9 +671,9 @@
//
// FMODstopButton
//
this.FMODstopButton.Location = new System.Drawing.Point(151, 95);
this.FMODstopButton.Location = new System.Drawing.Point(374, 320);
this.FMODstopButton.Name = "FMODstopButton";
this.FMODstopButton.Size = new System.Drawing.Size(55, 42);
this.FMODstopButton.Size = new System.Drawing.Size(55, 46);
this.FMODstopButton.TabIndex = 2;
this.FMODstopButton.Text = "Stop";
this.FMODstopButton.UseVisualStyleBackColor = true;
@@ -655,9 +681,9 @@
//
// FMODpauseButton
//
this.FMODpauseButton.Location = new System.Drawing.Point(90, 95);
this.FMODpauseButton.Location = new System.Drawing.Point(313, 320);
this.FMODpauseButton.Name = "FMODpauseButton";
this.FMODpauseButton.Size = new System.Drawing.Size(55, 42);
this.FMODpauseButton.Size = new System.Drawing.Size(55, 46);
this.FMODpauseButton.TabIndex = 1;
this.FMODpauseButton.Text = "Pause";
this.FMODpauseButton.UseVisualStyleBackColor = true;
@@ -665,9 +691,9 @@
//
// FMODplayButton
//
this.FMODplayButton.Location = new System.Drawing.Point(29, 95);
this.FMODplayButton.Location = new System.Drawing.Point(252, 320);
this.FMODplayButton.Name = "FMODplayButton";
this.FMODplayButton.Size = new System.Drawing.Size(55, 42);
this.FMODplayButton.Size = new System.Drawing.Size(55, 46);
this.FMODplayButton.TabIndex = 0;
this.FMODplayButton.Text = "Play";
this.FMODplayButton.UseVisualStyleBackColor = true;
@@ -681,7 +707,7 @@
this.fontPreviewBox.Name = "fontPreviewBox";
this.fontPreviewBox.ReadOnly = true;
this.fontPreviewBox.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
this.fontPreviewBox.Size = new System.Drawing.Size(838, 581);
this.fontPreviewBox.Size = new System.Drawing.Size(838, 635);
this.fontPreviewBox.TabIndex = 0;
this.fontPreviewBox.Text = resources.GetString("fontPreviewBox.Text");
this.fontPreviewBox.Visible = false;
@@ -696,18 +722,29 @@
this.textPreviewBox.Name = "textPreviewBox";
this.textPreviewBox.ReadOnly = true;
this.textPreviewBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textPreviewBox.Size = new System.Drawing.Size(838, 581);
this.textPreviewBox.Size = new System.Drawing.Size(838, 635);
this.textPreviewBox.TabIndex = 2;
this.textPreviewBox.Visible = false;
this.textPreviewBox.WordWrap = false;
//
// glControl1
//
this.glControl1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
this.glControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.glControl1.Location = new System.Drawing.Point(0, 0);
this.glControl1.Name = "glControl1";
this.glControl1.Size = new System.Drawing.Size(838, 635);
this.glControl1.TabIndex = 4;
this.glControl1.VSync = false;
this.glControl1.Paint += new System.Windows.Forms.PaintEventHandler(this.glControl1_Paint);
//
// classPreviewPanel
//
this.classPreviewPanel.Controls.Add(this.classTextBox);
this.classPreviewPanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.classPreviewPanel.Location = new System.Drawing.Point(0, 0);
this.classPreviewPanel.Name = "classPreviewPanel";
this.classPreviewPanel.Size = new System.Drawing.Size(838, 581);
this.classPreviewPanel.Size = new System.Drawing.Size(838, 635);
this.classPreviewPanel.TabIndex = 3;
this.classPreviewPanel.Visible = false;
//
@@ -719,7 +756,7 @@
this.classTextBox.Name = "classTextBox";
this.classTextBox.ReadOnly = true;
this.classTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.classTextBox.Size = new System.Drawing.Size(838, 581);
this.classTextBox.Size = new System.Drawing.Size(838, 635);
this.classTextBox.TabIndex = 3;
this.classTextBox.WordWrap = false;
//
@@ -727,7 +764,7 @@
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatusLabel1});
this.statusStrip1.Location = new System.Drawing.Point(0, 581);
this.statusStrip1.Location = new System.Drawing.Point(0, 635);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(838, 22);
this.statusStrip1.TabIndex = 2;
@@ -783,6 +820,11 @@
//
this.timer.Interval = 10;
this.timer.Tick += new System.EventHandler(this.timer_Tick);
//
// timerOpenTK
//
this.timerOpenTK.Interval = 1000 / 6;
this.timerOpenTK.Tick += new System.EventHandler(this.timerOpenTK_Tick);
//
// openFileDialog1
//
@@ -813,24 +855,32 @@
this.saveFolderDialog1.RestoreDirectory = true;
this.saveFolderDialog1.Title = "Browse for folder";
//
// all3DObjectssplitToolStripMenuItem
// contextMenuStrip1
//
this.all3DObjectssplitToolStripMenuItem.Name = "all3DObjectssplitToolStripMenuItem";
this.all3DObjectssplitToolStripMenuItem.Size = new System.Drawing.Size(192, 22);
this.all3DObjectssplitToolStripMenuItem.Text = "All 3D objects (split)";
this.all3DObjectssplitToolStripMenuItem.Click += new System.EventHandler(this.all3DObjectssplitToolStripMenuItem_Click);
this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.showOriginalFileToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(202, 56);
//
// showOriginalFileToolStripMenuItem
//
this.showOriginalFileToolStripMenuItem.Name = "showOriginalFileToolStripMenuItem";
this.showOriginalFileToolStripMenuItem.Size = new System.Drawing.Size(201, 24);
this.showOriginalFileToolStripMenuItem.Text = "show original file";
this.showOriginalFileToolStripMenuItem.Click += new System.EventHandler(this.showOriginalFileToolStripMenuItem_Click);
//
// UnityStudioForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1264, 630);
this.ClientSize = new System.Drawing.Size(1264, 683);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.menuStrip1);
this.Icon = Properties.Resources.unity;
this.Icon = global::Unity_Studio.Properties.Resources.unity;
this.KeyPreview = true;
this.MainMenuStrip = this.menuStrip1;
this.MinimumSize = new System.Drawing.Size(620, 372);
this.MinimumSize = new System.Drawing.Size(620, 400);
this.Name = "UnityStudioForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Unity Studio";
@@ -848,6 +898,7 @@
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
this.progressbarPanel.ResumeLayout(false);
this.glControl1.ResumeLayout(false);
this.previewPanel.ResumeLayout(false);
this.previewPanel.PerformLayout();
this.FMODpanel.ResumeLayout(false);
@@ -859,6 +910,7 @@
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.tabPage3.ResumeLayout(false);
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
@@ -904,9 +956,11 @@
private System.Windows.Forms.Label FMODtimerLabel;
private System.Windows.Forms.Label FMODinfoLabel;
private System.Windows.Forms.Timer timer;
private System.Windows.Forms.Timer timerOpenTK;
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem displayAll;
private System.Windows.Forms.ToolStripMenuItem displayOriginalName;
private System.Windows.Forms.ToolStripMenuItem enablePreview;
private System.Windows.Forms.ToolStripMenuItem displayInfo;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
@@ -938,6 +992,9 @@
private System.Windows.Forms.ToolStripMenuItem exportClassStructuresMenuItem;
private System.Windows.Forms.Label FMODcopyright;
private System.Windows.Forms.ToolStripMenuItem all3DObjectssplitToolStripMenuItem;
private OpenTK.GLControl glControl1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem showOriginalFileToolStripMenuItem;
}
}

View File

@@ -11,9 +11,10 @@ using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Diagnostics;
using System.Drawing.Text;
using OpenTK;
using OpenTK.Graphics.OpenGL;
using static Unity_Studio.UnityStudio;
namespace Unity_Studio
{
partial class UnityStudioForm : Form
@@ -34,6 +35,28 @@ namespace Unity_Studio
private Bitmap imageTexture;
#region OpenTK variables
int pgmID;
int vsID;
int fsID;
int attributeVertexPosition;
int attributeNormalDirection;
int attributeVertexColor;
int uniformViewMatrix;
int vao;
int vboPositions;
int vboNormals;
int vboColors;
int vboViewMatrix;
int eboElements;
Vector3[] vertexData;
Vector3[] normalData;
Vector4[] colorData;
Matrix4[] viewMatrixData;
int[] indiceData;
bool wireFrameView;
#endregion
//asset list sorting helpers
private int firstSortColumn = -1;
private int secondSortColumn;
@@ -46,11 +69,13 @@ namespace Unity_Studio
private PrivateFontCollection pfc = new PrivateFontCollection();
private AssetPreloadData selectasset;
[DllImport("gdi32.dll")]
private static extern IntPtr AddFontMemResourceEx(IntPtr pbFont, uint cbFont, IntPtr pdv, [In] ref uint pcFonts);
private void loadFile_Click(object sender, System.EventArgs e)
private void loadFile_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
@@ -58,7 +83,7 @@ namespace Unity_Studio
mainPath = Path.GetDirectoryName(openFileDialog1.FileNames[0]);
ThreadPool.QueueUserWorkItem(state =>
{
if (openFileDialog1.FilterIndex == 1)
if (openFileDialog1.FilterIndex == 1 || openFileDialog1.FilterIndex == 3)
{
MergeSplitAssets(mainPath);
@@ -95,7 +120,7 @@ namespace Unity_Studio
}
}
private void loadFolder_Click(object sender, System.EventArgs e)
private void loadFolder_Click(object sender, EventArgs e)
{
/*FolderBrowserDialog folderBrowserDialog1 = new FolderBrowserDialog();
@@ -245,17 +270,17 @@ namespace Unity_Studio
bool optionBuildHierarchyMenuItem = !dontBuildHierarchyMenuItem.Checked;
bool optionBuildClassStructuresMenuItem = buildClassStructuresMenuItem.Checked;
BuildAssetStructures(optionLoadAssetsMenuItem, optionDisplayAll, optionBuildHierarchyMenuItem, optionBuildClassStructuresMenuItem);
BuildAssetStructures(optionLoadAssetsMenuItem, optionDisplayAll, optionBuildHierarchyMenuItem, optionBuildClassStructuresMenuItem, displayOriginalName.Checked);
BeginInvoke(new Action(() =>
{
if (productName != "")
{
this.Text = "Unity Studio - " + productName + " - " + assetsfileList[0].m_Version + " - " + assetsfileList[0].platformStr;
Text = "Unity Studio - " + productName + " - " + assetsfileList[0].m_Version + " - " + assetsfileList[0].platformStr;
}
else if (assetsfileList.Count > 0)
{
this.Text = "Unity Studio - no productName - " + assetsfileList[0].m_Version + " - " + assetsfileList[0].platformStr;
Text = "Unity Studio - no productName - " + assetsfileList[0].m_Version + " - " + assetsfileList[0].platformStr;
}
if (!dontLoadAssetsMenuItem.Checked)
{
@@ -302,6 +327,96 @@ namespace Unity_Studio
if (tabControl1.TabPages.Contains(tabPage3)) { tabControl1.TabPages.Remove(tabPage3); }
else { tabControl1.TabPages.Add(tabPage3); }
}
if (glControl1.Visible == true)
{
// --> Right
if (e.KeyCode == Keys.D)
{
if (e.Shift && e.KeyCode == Keys.D) //Move
{
viewMatrixData[0] *= Matrix4.CreateTranslation(0.1f, 0, 0);
}
else //Rotate
{
viewMatrixData[0] *= Matrix4.CreateRotationY(0.1f);
}
GL.UniformMatrix4(uniformViewMatrix, false, ref viewMatrixData[0]);
glControl1.Invalidate();
}
// <-- Left
if (e.KeyCode == Keys.A)
{
if (e.Shift && e.KeyCode == Keys.A) //Move
{
viewMatrixData[0] *= Matrix4.CreateTranslation(-0.1f, 0, 0);
}
else //Rotate
{
viewMatrixData[0] *= Matrix4.CreateRotationY(-0.1f);
}
GL.UniformMatrix4(uniformViewMatrix, false, ref viewMatrixData[0]);
glControl1.Invalidate();
}
// Up
if (e.KeyCode == Keys.W)
{
if (e.Control && e.KeyCode == Keys.W) //Toggle WireFrame
{
wireFrameView = !wireFrameView;
glControl1.Invalidate();
}
else if (e.Shift && e.KeyCode == Keys.W) //Move
{
viewMatrixData[0] *= Matrix4.CreateTranslation(0, 0.1f, 0);
}
else //Rotate
{
viewMatrixData[0] *= Matrix4.CreateRotationX(0.1f);
}
GL.UniformMatrix4(uniformViewMatrix, false, ref viewMatrixData[0]);
glControl1.Invalidate();
}
// Down
if (e.KeyCode == Keys.S)
{
if (e.Shift && e.KeyCode == Keys.S) //Move
{
viewMatrixData[0] *= Matrix4.CreateTranslation(0, -0.1f, 0);
}
else //Rotate
{
viewMatrixData[0] *= Matrix4.CreateRotationX(-0.1f);
}
GL.UniformMatrix4(uniformViewMatrix, false, ref viewMatrixData[0]);
glControl1.Invalidate();
}
// Zoom Out
if (e.KeyCode == Keys.Q)
{
viewMatrixData[0] *= Matrix4.CreateScale(0.9f);
GL.UniformMatrix4(uniformViewMatrix, false, ref viewMatrixData[0]);
glControl1.Invalidate();
}
// Zoom In
if (e.KeyCode == Keys.E)
{
viewMatrixData[0] *= Matrix4.CreateScale(1.1f);
GL.UniformMatrix4(uniformViewMatrix, false, ref viewMatrixData[0]);
glControl1.Invalidate();
}
// Toggle Timer
if (e.KeyCode == Keys.T)
{
timerOpenTK.Enabled = !timerOpenTK.Enabled;
}
}
}
private void dontLoadAssetsMenuItem_CheckedChanged(object sender, EventArgs e)
@@ -483,7 +598,7 @@ namespace Unity_Studio
if (treeSearch.Text == " Search ")
{
treeSearch.Text = "";
treeSearch.ForeColor = System.Drawing.SystemColors.WindowText;
treeSearch.ForeColor = SystemColors.WindowText;
}
}
@@ -492,7 +607,7 @@ namespace Unity_Studio
if (treeSearch.Text == "")
{
treeSearch.Text = " Search ";
treeSearch.ForeColor = System.Drawing.SystemColors.GrayText;
treeSearch.ForeColor = SystemColors.GrayText;
}
}
@@ -576,28 +691,12 @@ namespace Unity_Studio
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;
listSearch.ForeColor = SystemColors.WindowText;
enableFiltering = true;
}
}
@@ -608,7 +707,7 @@ namespace Unity_Studio
{
enableFiltering = false;
listSearch.Text = " Filter ";
listSearch.ForeColor = System.Drawing.SystemColors.GrayText;
listSearch.ForeColor = SystemColors.GrayText;
}
}
@@ -619,7 +718,7 @@ namespace Unity_Studio
assetListView.BeginUpdate();
assetListView.SelectedIndices.Clear();
//visibleListAssets = exportableAssets.FindAll(ListAsset => ListAsset.Text.StartsWith(ListSearch.Text, System.StringComparison.CurrentCultureIgnoreCase));
visibleAssets = exportableAssets.FindAll(ListAsset => ListAsset.Text.IndexOf(listSearch.Text, System.StringComparison.CurrentCultureIgnoreCase) >= 0);
visibleAssets = exportableAssets.FindAll(ListAsset => ListAsset.Text.IndexOf(listSearch.Text, StringComparison.CurrentCultureIgnoreCase) >= 0);
assetListView.VirtualListSize = visibleAssets.Count;
assetListView.EndUpdate();
}
@@ -645,7 +744,7 @@ namespace Unity_Studio
{
int xdiff = reverseSort ? b.Text.CompareTo(a.Text) : a.Text.CompareTo(b.Text);
if (xdiff != 0) return xdiff;
else return secondSortColumn == 1 ? a.TypeString.CompareTo(b.TypeString) : a.Size.CompareTo(b.Size);
return secondSortColumn == 1 ? a.TypeString.CompareTo(b.TypeString) : a.Size.CompareTo(b.Size);
});
break;
case 1:
@@ -653,7 +752,7 @@ namespace Unity_Studio
{
int xdiff = reverseSort ? b.TypeString.CompareTo(a.TypeString) : a.TypeString.CompareTo(b.TypeString);
if (xdiff != 0) return xdiff;
else return secondSortColumn == 2 ? a.Size.CompareTo(b.Size) : a.Text.CompareTo(b.Text);
return secondSortColumn == 2 ? a.Size.CompareTo(b.Size) : a.Text.CompareTo(b.Text);
});
break;
case 2:
@@ -661,7 +760,7 @@ namespace Unity_Studio
{
int xdiff = reverseSort ? b.Size.CompareTo(a.Size) : a.Size.CompareTo(b.Size);
if (xdiff != 0) return xdiff;
else return secondSortColumn == 1 ? a.TypeString.CompareTo(b.TypeString) : a.Text.CompareTo(b.Text);
return secondSortColumn == 1 ? a.TypeString.CompareTo(b.TypeString) : a.Text.CompareTo(b.Text);
});
break;
}
@@ -674,13 +773,14 @@ namespace Unity_Studio
private void selectAsset(object sender, ListViewItemSelectionChangedEventArgs e)
{
previewPanel.BackgroundImage = Properties.Resources.preview;
previewPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
previewPanel.BackgroundImageLayout = ImageLayout.Center;
assetInfoLabel.Visible = false;
assetInfoLabel.Text = null;
textPreviewBox.Visible = false;
fontPreviewBox.Visible = false;
pfc.Dispose();
FMODpanel.Visible = false;
glControl1.Visible = false;
lastLoadedAsset = null;
StatusStripUpdate("");
@@ -778,6 +878,7 @@ namespace Unity_Studio
Shader m_TextAsset = new Shader(asset, true);
string m_Script_Text = Encoding.UTF8.GetString(m_TextAsset.m_Script);
m_Script_Text = Regex.Replace(m_Script_Text, "(?<!\r)\n", "\r\n");
m_Script_Text = m_Script_Text.Replace("\0", "\\0");
textPreviewBox.Text = m_Script_Text;
textPreviewBox.Visible = true;
break;
@@ -860,9 +961,114 @@ namespace Unity_Studio
break;
}
#endregion
#region Mesh
case 43: //Mesh
{
glControl1.Visible = true;
viewMatrixData = new Matrix4[] {
Matrix4.Identity
* Matrix4.CreateTranslation( 0.0f, -1.0f, 0.0f )
* Matrix4.CreateRotationY(-90.0f)};
var m_Mesh = new Mesh(asset, true);
if (m_Mesh.m_VertexCount > 0)
{
#region Vertices
int count = 3;
if (m_Mesh.m_Vertices.Length == m_Mesh.m_VertexCount * 4)
{
count = 4;
}
vertexData = new Vector3[m_Mesh.m_VertexCount];
for (int v = 0; v < m_Mesh.m_VertexCount; v++)
{
vertexData[v] = new Vector3(
m_Mesh.m_Vertices[v * count],
m_Mesh.m_Vertices[v * count + 1],
m_Mesh.m_Vertices[v * count + 2]);
}
#endregion
#region Indicies
indiceData = new int[m_Mesh.m_Indices.Count];
for (int i = 0; i < m_Mesh.m_Indices.Count; i = i + 3)
{
indiceData[i] = (int)m_Mesh.m_Indices[i];
indiceData[i + 1] = (int)m_Mesh.m_Indices[i + 1];
indiceData[i + 2] = (int)m_Mesh.m_Indices[i + 2];
}
#endregion
#region Normals
if (m_Mesh.m_Normals != null && m_Mesh.m_Normals.Length > 0)
{
if (m_Mesh.m_Normals.Length == m_Mesh.m_VertexCount * 3)
count = 3;
else if (m_Mesh.m_Normals.Length == m_Mesh.m_VertexCount * 4)
count = 4;
normalData = new Vector3[m_Mesh.m_VertexCount];
for (int n = 0; n < m_Mesh.m_VertexCount; n++)
{
normalData[n] = new Vector3(
m_Mesh.m_Normals[n * count],
m_Mesh.m_Normals[n * count + 1],
m_Mesh.m_Normals[n * count + 2]);
}
}
else
normalData = null;
#endregion
#region Colors
if (m_Mesh.m_Colors == null)
{
colorData = new Vector4[m_Mesh.m_VertexCount];
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
{
colorData[c] = new Vector4(
0.5f, 0.5f, 0.5f, 1.0f);
}
}
else if (m_Mesh.m_Colors.Length == m_Mesh.m_VertexCount * 3)
{
colorData = new Vector4[m_Mesh.m_VertexCount];
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
{
colorData[c] = new Vector4(
m_Mesh.m_Colors[c * 3],
m_Mesh.m_Colors[c * 3 + 1],
m_Mesh.m_Colors[c * 3 + 2],
1.0f);
}
}
else
{
colorData = new Vector4[m_Mesh.m_VertexCount];
for (int c = 0; c < m_Mesh.m_VertexCount; c++)
{
colorData[c] = new Vector4(
m_Mesh.m_Colors[c * 4],
m_Mesh.m_Colors[c * 4 + 1],
m_Mesh.m_Colors[c * 4 + 2],
m_Mesh.m_Colors[c * 4 + 3]);
}
}
#endregion
}
createVAO();
StatusStripUpdate("Using OpenGL Version: " + GL.GetString(StringName.Version)
+ " | 'T'=Start/Stop Rotation | 'WASD'=Manual Rotate | "
+ "'Shift WASD'=Move | 'Q/E'=Zoom | 'Ctl W' =Wireframe");
}
break;
#endregion
default:
{
StatusStripUpdate("Only supported export the raw file.");
string str;
if ((str = asset.ViewStruct()) != null)
{
textPreviewBox.Text = str;
textPreviewBox.Visible = true;
}
else
StatusStripUpdate("Only supported export the raw file.");
break;
}
}
@@ -1169,7 +1375,7 @@ namespace Unity_Studio
//Environment.Exit(-1);
return true;
}
else { return false; }
return false;
}
private void all3DObjectssplitToolStripMenuItem_Click(object sender, EventArgs e)
@@ -1195,6 +1401,7 @@ namespace Unity_Studio
//防止主界面假死
ThreadPool.QueueUserWorkItem(delegate
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
sceneTreeView.Invoke(new Action(() =>
{
//挂起控件防止更新
@@ -1302,6 +1509,7 @@ namespace Unity_Studio
ThreadPool.QueueUserWorkItem(delegate
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
var savePath = saveFolderDialog1.FileName;
if (Path.GetFileName(savePath) == "Select folder or write folder name to create")
{ savePath = Path.GetDirectoryName(saveFolderDialog1.FileName); }
@@ -1336,9 +1544,10 @@ namespace Unity_Studio
}
break;
case 48:
Shader m_Shader = new Shader(asset, true);
if (!ExportFileExists(exportpath + asset.Text + asset.extension))
{
ExportShader(new Shader(asset, true), exportpath + asset.Text + ".txt");
ExportShader(m_Shader, exportpath + asset.Text + ".txt");
exportedCount++;
}
break;
@@ -1365,6 +1574,15 @@ namespace Unity_Studio
ExportFont(m_Font, exportpath + asset.Text + asset.extension);
exportedCount++;
}
break;
case 43: //Mesh
Mesh m_Mesh = new Mesh(asset, true);
if (!ExportFileExists(exportpath + asset.Text + asset.extension))
{
ExportMesh(m_Mesh, exportpath + asset.Text + asset.extension);
exportedCount++;
}
break;
default:
if (!ExportFileExists(exportpath + asset.Text + asset.extension))
@@ -1465,6 +1683,7 @@ namespace Unity_Studio
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
InitializeComponent();
displayOriginalName.Checked = (bool)Properties.Settings.Default["displayOriginalName"];
displayAll.Checked = (bool)Properties.Settings.Default["displayAll"];
displayInfo.Checked = (bool)Properties.Settings.Default["displayInfo"];
enablePreview.Checked = (bool)Properties.Settings.Default["enablePreview"];
@@ -1479,6 +1698,125 @@ namespace Unity_Studio
UnityStudio.ProgressBarMaximumAdd = ProgressBarMaximumAdd;
}
private void timerOpenTK_Tick(object sender, EventArgs e)
{
if (glControl1.Visible == true)
{
viewMatrixData[0] *= Matrix4.CreateRotationY(-0.1f);
GL.UniformMatrix4(uniformViewMatrix, false, ref viewMatrixData[0]);
glControl1.Invalidate();
}
}
private void initOpenTK()
{
GL.Viewport(0, 0, glControl1.ClientSize.Width, glControl1.ClientSize.Height);
GL.ClearColor(Color.CadetBlue);
pgmID = GL.CreateProgram();
loadShader("vs", ShaderType.VertexShader, pgmID, out vsID);
loadShader("fs", ShaderType.FragmentShader, pgmID, out fsID);
GL.LinkProgram(pgmID);
GL.UseProgram(pgmID);
attributeVertexPosition = GL.GetAttribLocation(pgmID, "vertexPosition");
attributeNormalDirection = GL.GetAttribLocation(pgmID, "normalDirection");
attributeVertexColor = GL.GetAttribLocation(pgmID, "vertexColor");
uniformViewMatrix = GL.GetUniformLocation(pgmID, "viewMatrix");
glControl1.Visible = false;
}
private void loadShader(string filename, ShaderType type, int program, out int address)
{
address = GL.CreateShader(type);
var str = (string)Resource1.ResourceManager.GetObject(filename);
GL.ShaderSource(address, str);
GL.CompileShader(address);
GL.AttachShader(program, address);
GL.DeleteShader(address);
}
private void createVBO(out int vboAddress, Vector3[] data, int address)
{
GL.GenBuffers(1, out vboAddress);
GL.BindBuffer(BufferTarget.ArrayBuffer, vboAddress);
GL.BufferData(BufferTarget.ArrayBuffer,
(IntPtr)(data.Length * Vector3.SizeInBytes),
data,
BufferUsageHint.StaticDraw);
GL.VertexAttribPointer(address, 3, VertexAttribPointerType.Float, false, 0, 0);
GL.EnableVertexAttribArray(address);
}
private void createVBO(out int vboAddress, Vector4[] data, int address)
{
GL.GenBuffers(1, out vboAddress);
GL.BindBuffer(BufferTarget.ArrayBuffer, vboAddress);
GL.BufferData(BufferTarget.ArrayBuffer,
(IntPtr)(data.Length * Vector4.SizeInBytes),
data,
BufferUsageHint.StaticDraw);
GL.VertexAttribPointer(address, 4, VertexAttribPointerType.Float, false, 0, 0);
GL.EnableVertexAttribArray(address);
}
private void createVBO(out int vboAddress, Matrix4[] data, int address)
{
GL.GenBuffers(1, out vboAddress);
GL.UniformMatrix4(address, false, ref data[0]);
}
private void createEBO(out int address, int[] data)
{
GL.GenBuffers(1, out address);
GL.BindBuffer(BufferTarget.ElementArrayBuffer, address);
GL.BufferData(BufferTarget.ElementArrayBuffer,
(IntPtr)(data.Length * sizeof(int)),
data,
BufferUsageHint.StaticDraw);
}
private void createVAO()
{
timerOpenTK.Stop();
GL.DeleteVertexArray(vao);
GL.GenVertexArrays(1, out vao);
GL.BindVertexArray(vao);
createVBO(out vboPositions, vertexData, attributeVertexPosition);
if (normalData != null)
createVBO(out vboNormals, normalData, attributeNormalDirection);
createVBO(out vboColors, colorData, attributeVertexColor);
createVBO(out vboViewMatrix, viewMatrixData, uniformViewMatrix);
createEBO(out eboElements, indiceData);
GL.BindBuffer(BufferTarget.ArrayBuffer, 0);
GL.BindVertexArray(0);
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
initOpenTK();
}
private void glControl1_Paint(object sender, PaintEventArgs e)
{
glControl1.MakeCurrent();
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
GL.Enable(EnableCap.DepthTest);
GL.DepthFunc(DepthFunction.Less);
GL.BindVertexArray(vao);
if (wireFrameView == true)
{
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Line); //Wireframe
}
else
{
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
}
GL.DrawElements(BeginMode.Triangles, indiceData.Length, DrawElementsType.UnsignedInt, 0);
GL.BindVertexArray(0);
GL.Flush();
glControl1.SwapBuffers();
}
private void resetForm()
{
/*Properties.Settings.Default["uniqueNames"] = uniqueNamesMenuItem.Checked;
@@ -1486,13 +1824,13 @@ namespace Unity_Studio
Properties.Settings.Default["displayInfo"] = displayAssetInfoMenuItem.Checked;
Properties.Settings.Default.Save();*/
base.Text = "Unity Studio";
Text = "Unity Studio";
unityFiles.Clear();
assetsfileList.Clear();
exportableAssets.Clear();
visibleAssets.Clear();
UnityStudio.assetsfileandstream.Clear();
assetsfileandstream.Clear();
sceneTreeView.Nodes.Clear();
@@ -1504,11 +1842,12 @@ namespace Unity_Studio
classesListView.Groups.Clear();
previewPanel.BackgroundImage = Properties.Resources.preview;
previewPanel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
previewPanel.BackgroundImageLayout = ImageLayout.Center;
assetInfoLabel.Visible = false;
assetInfoLabel.Text = null;
textPreviewBox.Visible = false;
fontPreviewBox.Visible = false;
glControl1.Visible = false;
lastSelectedItem = null;
lastLoadedAsset = null;
firstSortColumn = -1;
@@ -1520,5 +1859,21 @@ namespace Unity_Studio
FMODreset();
}
private void showOriginalFileToolStripMenuItem_Click(object sender, EventArgs e)
{
var args = $"/select, {selectasset.sourceFile.bundlePath ?? selectasset.sourceFile.filePath}";
var pfi = new ProcessStartInfo("explorer.exe", args);
Process.Start(pfi);
}
private void assetListView_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
selectasset = (AssetPreloadData)assetListView.Items[assetListView.SelectedIndices[0]];
contextMenuStrip1.Show(assetListView, e.X, e.Y);
}
}
}
}

View File

@@ -149,7 +149,7 @@ The quick brown fox jumps over the lazy dog. 1234567890</value>
<value>636, 17</value>
</data>
<data name="openFileDialog1.Filter" xml:space="preserve">
<value>Unity asset files|level*; globalgamemanagers; mainData; CustomAssetBundle-*; CAB-*; BuildPlayer-*; *.assets; *.sharedAssets|Unity bundle files|*.unity3d; *.unity3d.lz4; *.assetbundle; *.bundle; *.bytes</value>
<value>Unity asset files|*.*|Unity bundle files|*.*|Unity asset files|level*; globalgamemanagers; mainData; CustomAssetBundle-*; CAB-*; BuildPlayer-*; *.assets; *.sharedAssets|Unity bundle files|*.unity3d; *.unity3d.lz4; *.assetbundle; *.bundle; *.bytes</value>
</data>
<data name="openFolderDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing">
<value>169, 17</value>

View File

@@ -58,6 +58,18 @@
<setting name="convertType" serializeAs="String">
<value>PNG</value>
</setting>
<setting name="displayOriginalName" serializeAs="String">
<value>False</value>
</setting>
</Unity_Studio.Properties.Settings>
</userSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="OpenTK" publicKeyToken="bad199fe84eb3df4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -1,56 +0,0 @@
7-Zip
~~~~~
License for use and distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7-Zip Copyright (C) 1999-2015 Igor Pavlov.
Licenses for files are:
1) 7z.dll: GNU LGPL + unRAR restriction
2) All other files: GNU LGPL
The GNU LGPL + unRAR restriction means that you must follow both
GNU LGPL rules and unRAR restriction rules.
Note:
You can use 7-Zip on any computer, including a computer in a commercial
organization. You don't need to register or pay for 7-Zip.
GNU LGPL information
--------------------
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You can receive a copy of the GNU Lesser General Public License from
http://www.gnu.org/
unRAR restriction
-----------------
The decompression engine for RAR archives was developed using source
code of unRAR program.
All copyrights to original unRAR code are owned by Alexander Roshal.
The license for original unRAR code has the following restriction:
The unRAR sources cannot be used to re-create the RAR compression algorithm,
which is proprietary. Distribution of modified unRAR sources in separate form
or as a part of other software is permitted, provided that it is clearly
stated in the documentation and source comments that the code may
not be used to develop a RAR (WinRAR) compatible archiver.
--
Igor Pavlov

View File

@@ -0,0 +1,52 @@
The Open Toolkit library license
Copyright (c) 2006 - 2014 Stefanos Apostolopoulos <stapostol@gmail.com> for the Open Toolkit library.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Third parties
OpenTK.Platform.Windows and OpenTK.Platform.X11 include portions of the Mono class library. These portions are covered by the following license:
Copyright (c) 2004 Novell, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
OpenTK.Compatibility includes portions of the Tao Framework library (Tao.OpenGl, Tao.OpenAl and Tao.Platform.Windows.SimpleOpenGlControl). These portions are covered by the following license:
Copyright <20>2003-2007 Tao Framework Team
http://www.taoframework.com
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
OpenTK.Half offers Half-to-Single and Single-to-Half conversions based on OpenEXR source code, which is covered by the following license:
Copyright (c) 2002, Industrial Light & Magic, a division of Lucas Digital Ltd. LLC. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of Industrial Light & Magic nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Binary file not shown.

Binary file not shown.