Skip to content

Commit

Permalink
some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Perfare committed Mar 27, 2018
1 parent f87390c commit e5104d5
Show file tree
Hide file tree
Showing 14 changed files with 493 additions and 517 deletions.
31 changes: 31 additions & 0 deletions UnityStudio/Classes/AudioClip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,4 +300,35 @@ public bool IsFMODSupport
}
}
}

public enum AudioType
{
UNKNOWN,
ACC,
AIFF,
IT = 10,
MOD = 12,
MPEG,
OGGVORBIS,
S3M = 17,
WAV = 20,
XM,
XMA,
VAG,
AUDIOQUEUE
}

public enum AudioCompressionFormat
{
PCM,
Vorbis,
ADPCM,
MP3,
VAG,
HEVAG,
XMA,
AAC,
GCADPCM,
ATRAC9
}
}
File renamed without changes.
61 changes: 61 additions & 0 deletions UnityStudio/Classes/Texture2D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -775,4 +775,65 @@ private void SetBGRA32Info(byte[] BGRA32)
dwABitMask = -16777216;
}
}

public enum TextureFormat
{
Alpha8 = 1,
ARGB4444,
RGB24,
RGBA32,
ARGB32,
RGB565 = 7,
R16 = 9,
DXT1,
DXT5 = 12,
RGBA4444,
BGRA32,
RHalf,
RGHalf,
RGBAHalf,
RFloat,
RGFloat,
RGBAFloat,
YUY2,
RGB9e5Float,
BC4 = 26,
BC5,
BC6H = 24,
BC7,
DXT1Crunched = 28,
DXT5Crunched,
PVRTC_RGB2,
PVRTC_RGBA2,
PVRTC_RGB4,
PVRTC_RGBA4,
ETC_RGB4,
ATC_RGB4,
ATC_RGBA8,
EAC_R = 41,
EAC_R_SIGNED,
EAC_RG,
EAC_RG_SIGNED,
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,
RG16,
R8,
ETC_RGB4Crunched,
ETC2_RGBA8Crunched,
}
}
1 change: 1 addition & 0 deletions UnityStudio/StudioClasses/AssetPreloadData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class AssetPreloadData : ListViewItem
public long m_PathID;
public uint Offset;
public int Size;
public ClassIDReference Type;
public int Type1;
public int Type2;

Expand Down
14 changes: 8 additions & 6 deletions UnityStudio/StudioClasses/AssetsFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class AssetsFile
{
public EndianBinaryReader assetsFileReader;
public string filePath;
public string bundlePath;
public string parentPath;
public string fileName;
public string upperFileName;
public int fileGen;
Expand Down Expand Up @@ -220,7 +220,7 @@ public AssetsFile(string fullName, EndianBinaryReader reader)
assetsFileReader.endian = EndianType.LittleEndian;
}

platformStr = Enum.TryParse(platform.ToString(), out BuildTarget buildTarget) ? buildTarget.ToString() : "Unknown Platform";
platformStr = Enum.IsDefined(typeof(BuildTarget), platform) ? ((BuildTarget)platform).ToString() : "Unknown Platform";

int baseCount = assetsFileReader.ReadInt32();
for (int i = 0; i < baseCount; i++)
Expand Down Expand Up @@ -292,13 +292,15 @@ public AssetsFile(string fullName, EndianBinaryReader reader)
//but not the last!
}

if (ClassIDReference.Names.TryGetValue(asset.Type2, out var typeString))
if (Enum.IsDefined(typeof(ClassIDReference), asset.Type2))
{
asset.TypeString = typeString;
asset.Type = (ClassIDReference)asset.Type2;
asset.TypeString = asset.Type.ToString();
}
else
{
asset.TypeString = "Unknown Type " + asset.Type2;
asset.Type = ClassIDReference.UnknownType;
asset.TypeString = "UnknownType " + asset.Type2;
}

asset.uniqueID = i.ToString(assetIDfmt);
Expand All @@ -309,7 +311,7 @@ public AssetsFile(string fullName, EndianBinaryReader reader)
preloadTable.Add(asset.m_PathID, asset);

#region read BuildSettings to get version for unity 2.x files
if (asset.Type2 == 141 && fileGen == 6)
if (asset.Type == ClassIDReference.BuildSettings && fileGen == 6)
{
long nextAsset = assetsFileReader.Position;

Expand Down
46 changes: 46 additions & 0 deletions UnityStudio/StudioClasses/BuildTarget.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UnityStudio
{
public enum BuildTarget
{
DashboardWidget = 1,
StandaloneOSX = 2,
StandaloneOSXPPC = 3,
StandaloneOSXIntel = 4,
StandaloneWindows,
WebPlayer,
WebPlayerStreamed,
Wii = 8,
iOS = 9,
PS3,
XBOX360,
Android = 13,
StandaloneGLESEmu = 14,
NaCl = 16,
StandaloneLinux = 17,
FlashPlayer = 18,
StandaloneWindows64 = 19,
WebGL,
WSAPlayer,
StandaloneLinux64 = 24,
StandaloneLinuxUniversal,
WP8Player,
StandaloneOSXIntel64,
BlackBerry,
Tizen,
PSP2,
PS4,
PSM,
XboxOne,
SamsungTV,
N3DS,
WiiU,
tvOS,
Switch,
NoTarget = -2
}
}
Loading

0 comments on commit e5104d5

Please sign in to comment.