Update README.md

Updated project
Support 2017.4
This commit is contained in:
Perfare
2018-03-25 13:53:52 +08:00
parent a062905734
commit f87390cc2b
104 changed files with 179 additions and 179 deletions

View File

@@ -0,0 +1,55 @@
// Common/CRC.cs
namespace SevenZip
{
class CRC
{
public static readonly uint[] Table;
static CRC()
{
Table = new uint[256];
const uint kPoly = 0xEDB88320;
for (uint i = 0; i < 256; i++)
{
uint r = i;
for (int j = 0; j < 8; j++)
if ((r & 1) != 0)
r = (r >> 1) ^ kPoly;
else
r >>= 1;
Table[i] = r;
}
}
uint _value = 0xFFFFFFFF;
public void Init() { _value = 0xFFFFFFFF; }
public void UpdateByte(byte b)
{
_value = Table[(((byte)(_value)) ^ b)] ^ (_value >> 8);
}
public void Update(byte[] data, uint offset, uint size)
{
for (uint i = 0; i < size; i++)
_value = Table[(((byte)(_value)) ^ data[offset + i])] ^ (_value >> 8);
}
public uint GetDigest() { return _value ^ 0xFFFFFFFF; }
static uint CalculateDigest(byte[] data, uint offset, uint size)
{
CRC crc = new CRC();
// crc.Init();
crc.Update(data, offset, size);
return crc.GetDigest();
}
static bool VerifyDigest(uint digest, byte[] data, uint offset, uint size)
{
return (CalculateDigest(data, offset, size) == digest);
}
}
}

View File

@@ -0,0 +1,274 @@
// CommandLineParser.cs
using System;
using System.Collections;
namespace SevenZip.CommandLineParser
{
public enum SwitchType
{
Simple,
PostMinus,
LimitedPostString,
UnLimitedPostString,
PostChar
}
public class SwitchForm
{
public string IDString;
public SwitchType Type;
public bool Multi;
public int MinLen;
public int MaxLen;
public string PostCharSet;
public SwitchForm(string idString, SwitchType type, bool multi,
int minLen, int maxLen, string postCharSet)
{
IDString = idString;
Type = type;
Multi = multi;
MinLen = minLen;
MaxLen = maxLen;
PostCharSet = postCharSet;
}
public SwitchForm(string idString, SwitchType type, bool multi, int minLen):
this(idString, type, multi, minLen, 0, "")
{
}
public SwitchForm(string idString, SwitchType type, bool multi):
this(idString, type, multi, 0)
{
}
}
public class SwitchResult
{
public bool ThereIs;
public bool WithMinus;
public ArrayList PostStrings = new ArrayList();
public int PostCharIndex;
public SwitchResult()
{
ThereIs = false;
}
}
public class Parser
{
public ArrayList NonSwitchStrings = new ArrayList();
SwitchResult[] _switches;
public Parser(int numSwitches)
{
_switches = new SwitchResult[numSwitches];
for (int i = 0; i < numSwitches; i++)
_switches[i] = new SwitchResult();
}
bool ParseString(string srcString, SwitchForm[] switchForms)
{
int len = srcString.Length;
if (len == 0)
return false;
int pos = 0;
if (!IsItSwitchChar(srcString[pos]))
return false;
while (pos < len)
{
if (IsItSwitchChar(srcString[pos]))
pos++;
const int kNoLen = -1;
int matchedSwitchIndex = 0;
int maxLen = kNoLen;
for (int switchIndex = 0; switchIndex < _switches.Length; switchIndex++)
{
int switchLen = switchForms[switchIndex].IDString.Length;
if (switchLen <= maxLen || pos + switchLen > len)
continue;
if (String.Compare(switchForms[switchIndex].IDString, 0,
srcString, pos, switchLen, true) == 0)
{
matchedSwitchIndex = switchIndex;
maxLen = switchLen;
}
}
if (maxLen == kNoLen)
throw new Exception("maxLen == kNoLen");
SwitchResult matchedSwitch = _switches[matchedSwitchIndex];
SwitchForm switchForm = switchForms[matchedSwitchIndex];
if ((!switchForm.Multi) && matchedSwitch.ThereIs)
throw new Exception("switch must be single");
matchedSwitch.ThereIs = true;
pos += maxLen;
int tailSize = len - pos;
SwitchType type = switchForm.Type;
switch (type)
{
case SwitchType.PostMinus:
{
if (tailSize == 0)
matchedSwitch.WithMinus = false;
else
{
matchedSwitch.WithMinus = (srcString[pos] == kSwitchMinus);
if (matchedSwitch.WithMinus)
pos++;
}
break;
}
case SwitchType.PostChar:
{
if (tailSize < switchForm.MinLen)
throw new Exception("switch is not full");
string charSet = switchForm.PostCharSet;
const int kEmptyCharValue = -1;
if (tailSize == 0)
matchedSwitch.PostCharIndex = kEmptyCharValue;
else
{
int index = charSet.IndexOf(srcString[pos]);
if (index < 0)
matchedSwitch.PostCharIndex = kEmptyCharValue;
else
{
matchedSwitch.PostCharIndex = index;
pos++;
}
}
break;
}
case SwitchType.LimitedPostString:
case SwitchType.UnLimitedPostString:
{
int minLen = switchForm.MinLen;
if (tailSize < minLen)
throw new Exception("switch is not full");
if (type == SwitchType.UnLimitedPostString)
{
matchedSwitch.PostStrings.Add(srcString.Substring(pos));
return true;
}
String stringSwitch = srcString.Substring(pos, minLen);
pos += minLen;
for (int i = minLen; i < switchForm.MaxLen && pos < len; i++, pos++)
{
char c = srcString[pos];
if (IsItSwitchChar(c))
break;
stringSwitch += c;
}
matchedSwitch.PostStrings.Add(stringSwitch);
break;
}
}
}
return true;
}
public void ParseStrings(SwitchForm[] switchForms, string[] commandStrings)
{
int numCommandStrings = commandStrings.Length;
bool stopSwitch = false;
for (int i = 0; i < numCommandStrings; i++)
{
string s = commandStrings[i];
if (stopSwitch)
NonSwitchStrings.Add(s);
else
if (s == kStopSwitchParsing)
stopSwitch = true;
else
if (!ParseString(s, switchForms))
NonSwitchStrings.Add(s);
}
}
public SwitchResult this[int index] { get { return _switches[index]; } }
public static int ParseCommand(CommandForm[] commandForms, string commandString,
out string postString)
{
for (int i = 0; i < commandForms.Length; i++)
{
string id = commandForms[i].IDString;
if (commandForms[i].PostStringMode)
{
if (commandString.IndexOf(id) == 0)
{
postString = commandString.Substring(id.Length);
return i;
}
}
else
if (commandString == id)
{
postString = "";
return i;
}
}
postString = "";
return -1;
}
static bool ParseSubCharsCommand(int numForms, CommandSubCharsSet[] forms,
string commandString, ArrayList indices)
{
indices.Clear();
int numUsedChars = 0;
for (int i = 0; i < numForms; i++)
{
CommandSubCharsSet charsSet = forms[i];
int currentIndex = -1;
int len = charsSet.Chars.Length;
for (int j = 0; j < len; j++)
{
char c = charsSet.Chars[j];
int newIndex = commandString.IndexOf(c);
if (newIndex >= 0)
{
if (currentIndex >= 0)
return false;
if (commandString.IndexOf(c, newIndex + 1) >= 0)
return false;
currentIndex = j;
numUsedChars++;
}
}
if (currentIndex == -1 && !charsSet.EmptyAllowed)
return false;
indices.Add(currentIndex);
}
return (numUsedChars == commandString.Length);
}
const char kSwitchID1 = '-';
const char kSwitchID2 = '/';
const char kSwitchMinus = '-';
const string kStopSwitchParsing = "--";
static bool IsItSwitchChar(char c)
{
return (c == kSwitchID1 || c == kSwitchID2);
}
}
public class CommandForm
{
public string IDString = "";
public bool PostStringMode = false;
public CommandForm(string idString, bool postStringMode)
{
IDString = idString;
PostStringMode = postStringMode;
}
}
class CommandSubCharsSet
{
public string Chars = "";
public bool EmptyAllowed = false;
}
}

View File

@@ -0,0 +1,72 @@
// InBuffer.cs
namespace SevenZip.Buffer
{
public class InBuffer
{
byte[] m_Buffer;
uint m_Pos;
uint m_Limit;
uint m_BufferSize;
System.IO.Stream m_Stream;
bool m_StreamWasExhausted;
ulong m_ProcessedSize;
public InBuffer(uint bufferSize)
{
m_Buffer = new byte[bufferSize];
m_BufferSize = bufferSize;
}
public void Init(System.IO.Stream stream)
{
m_Stream = stream;
m_ProcessedSize = 0;
m_Limit = 0;
m_Pos = 0;
m_StreamWasExhausted = false;
}
public bool ReadBlock()
{
if (m_StreamWasExhausted)
return false;
m_ProcessedSize += m_Pos;
int aNumProcessedBytes = m_Stream.Read(m_Buffer, 0, (int)m_BufferSize);
m_Pos = 0;
m_Limit = (uint)aNumProcessedBytes;
m_StreamWasExhausted = (aNumProcessedBytes == 0);
return (!m_StreamWasExhausted);
}
public void ReleaseStream()
{
// m_Stream.Close();
m_Stream = null;
}
public bool ReadByte(byte b) // check it
{
if (m_Pos >= m_Limit)
if (!ReadBlock())
return false;
b = m_Buffer[m_Pos++];
return true;
}
public byte ReadByte()
{
// return (byte)m_Stream.ReadByte();
if (m_Pos >= m_Limit)
if (!ReadBlock())
return 0xFF;
return m_Buffer[m_Pos++];
}
public ulong GetProcessedSize()
{
return m_ProcessedSize + m_Pos;
}
}
}

View File

@@ -0,0 +1,47 @@
// OutBuffer.cs
namespace SevenZip.Buffer
{
public class OutBuffer
{
byte[] m_Buffer;
uint m_Pos;
uint m_BufferSize;
System.IO.Stream m_Stream;
ulong m_ProcessedSize;
public OutBuffer(uint bufferSize)
{
m_Buffer = new byte[bufferSize];
m_BufferSize = bufferSize;
}
public void SetStream(System.IO.Stream stream) { m_Stream = stream; }
public void FlushStream() { m_Stream.Flush(); }
public void CloseStream() { m_Stream.Close(); }
public void ReleaseStream() { m_Stream = null; }
public void Init()
{
m_ProcessedSize = 0;
m_Pos = 0;
}
public void WriteByte(byte b)
{
m_Buffer[m_Pos++] = b;
if (m_Pos >= m_BufferSize)
FlushData();
}
public void FlushData()
{
if (m_Pos == 0)
return;
m_Stream.Write(m_Buffer, 0, (int)m_Pos);
m_Pos = 0;
}
public ulong GetProcessedSize() { return m_ProcessedSize + m_Pos; }
}
}

View File

@@ -0,0 +1,24 @@
// IMatchFinder.cs
using System;
namespace SevenZip.Compression.LZ
{
interface IInWindowStream
{
void SetStream(System.IO.Stream inStream);
void Init();
void ReleaseStream();
Byte GetIndexByte(Int32 index);
UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit);
UInt32 GetNumAvailableBytes();
}
interface IMatchFinder : IInWindowStream
{
void Create(UInt32 historySize, UInt32 keepAddBufferBefore,
UInt32 matchMaxLen, UInt32 keepAddBufferAfter);
UInt32 GetMatches(UInt32[] distances);
void Skip(UInt32 num);
}
}

View File

@@ -0,0 +1,367 @@
// LzBinTree.cs
using System;
namespace SevenZip.Compression.LZ
{
public class BinTree : InWindow, IMatchFinder
{
UInt32 _cyclicBufferPos;
UInt32 _cyclicBufferSize = 0;
UInt32 _matchMaxLen;
UInt32[] _son;
UInt32[] _hash;
UInt32 _cutValue = 0xFF;
UInt32 _hashMask;
UInt32 _hashSizeSum = 0;
bool HASH_ARRAY = true;
const UInt32 kHash2Size = 1 << 10;
const UInt32 kHash3Size = 1 << 16;
const UInt32 kBT2HashSize = 1 << 16;
const UInt32 kStartMaxLen = 1;
const UInt32 kHash3Offset = kHash2Size;
const UInt32 kEmptyHashValue = 0;
const UInt32 kMaxValForNormalize = ((UInt32)1 << 31) - 1;
UInt32 kNumHashDirectBytes = 0;
UInt32 kMinMatchCheck = 4;
UInt32 kFixHashSize = kHash2Size + kHash3Size;
public void SetType(int numHashBytes)
{
HASH_ARRAY = (numHashBytes > 2);
if (HASH_ARRAY)
{
kNumHashDirectBytes = 0;
kMinMatchCheck = 4;
kFixHashSize = kHash2Size + kHash3Size;
}
else
{
kNumHashDirectBytes = 2;
kMinMatchCheck = 2 + 1;
kFixHashSize = 0;
}
}
public new void SetStream(System.IO.Stream stream) { base.SetStream(stream); }
public new void ReleaseStream() { base.ReleaseStream(); }
public new void Init()
{
base.Init();
for (UInt32 i = 0; i < _hashSizeSum; i++)
_hash[i] = kEmptyHashValue;
_cyclicBufferPos = 0;
ReduceOffsets(-1);
}
public new void MovePos()
{
if (++_cyclicBufferPos >= _cyclicBufferSize)
_cyclicBufferPos = 0;
base.MovePos();
if (_pos == kMaxValForNormalize)
Normalize();
}
public new Byte GetIndexByte(Int32 index) { return base.GetIndexByte(index); }
public new UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit)
{ return base.GetMatchLen(index, distance, limit); }
public new UInt32 GetNumAvailableBytes() { return base.GetNumAvailableBytes(); }
public void Create(UInt32 historySize, UInt32 keepAddBufferBefore,
UInt32 matchMaxLen, UInt32 keepAddBufferAfter)
{
if (historySize > kMaxValForNormalize - 256)
throw new Exception();
_cutValue = 16 + (matchMaxLen >> 1);
UInt32 windowReservSize = (historySize + keepAddBufferBefore +
matchMaxLen + keepAddBufferAfter) / 2 + 256;
base.Create(historySize + keepAddBufferBefore, matchMaxLen + keepAddBufferAfter, windowReservSize);
_matchMaxLen = matchMaxLen;
UInt32 cyclicBufferSize = historySize + 1;
if (_cyclicBufferSize != cyclicBufferSize)
_son = new UInt32[(_cyclicBufferSize = cyclicBufferSize) * 2];
UInt32 hs = kBT2HashSize;
if (HASH_ARRAY)
{
hs = historySize - 1;
hs |= (hs >> 1);
hs |= (hs >> 2);
hs |= (hs >> 4);
hs |= (hs >> 8);
hs >>= 1;
hs |= 0xFFFF;
if (hs > (1 << 24))
hs >>= 1;
_hashMask = hs;
hs++;
hs += kFixHashSize;
}
if (hs != _hashSizeSum)
_hash = new UInt32[_hashSizeSum = hs];
}
public UInt32 GetMatches(UInt32[] distances)
{
UInt32 lenLimit;
if (_pos + _matchMaxLen <= _streamPos)
lenLimit = _matchMaxLen;
else
{
lenLimit = _streamPos - _pos;
if (lenLimit < kMinMatchCheck)
{
MovePos();
return 0;
}
}
UInt32 offset = 0;
UInt32 matchMinPos = (_pos > _cyclicBufferSize) ? (_pos - _cyclicBufferSize) : 0;
UInt32 cur = _bufferOffset + _pos;
UInt32 maxLen = kStartMaxLen; // to avoid items for len < hashSize;
UInt32 hashValue, hash2Value = 0, hash3Value = 0;
if (HASH_ARRAY)
{
UInt32 temp = CRC.Table[_bufferBase[cur]] ^ _bufferBase[cur + 1];
hash2Value = temp & (kHash2Size - 1);
temp ^= ((UInt32)(_bufferBase[cur + 2]) << 8);
hash3Value = temp & (kHash3Size - 1);
hashValue = (temp ^ (CRC.Table[_bufferBase[cur + 3]] << 5)) & _hashMask;
}
else
hashValue = _bufferBase[cur] ^ ((UInt32)(_bufferBase[cur + 1]) << 8);
UInt32 curMatch = _hash[kFixHashSize + hashValue];
if (HASH_ARRAY)
{
UInt32 curMatch2 = _hash[hash2Value];
UInt32 curMatch3 = _hash[kHash3Offset + hash3Value];
_hash[hash2Value] = _pos;
_hash[kHash3Offset + hash3Value] = _pos;
if (curMatch2 > matchMinPos)
if (_bufferBase[_bufferOffset + curMatch2] == _bufferBase[cur])
{
distances[offset++] = maxLen = 2;
distances[offset++] = _pos - curMatch2 - 1;
}
if (curMatch3 > matchMinPos)
if (_bufferBase[_bufferOffset + curMatch3] == _bufferBase[cur])
{
if (curMatch3 == curMatch2)
offset -= 2;
distances[offset++] = maxLen = 3;
distances[offset++] = _pos - curMatch3 - 1;
curMatch2 = curMatch3;
}
if (offset != 0 && curMatch2 == curMatch)
{
offset -= 2;
maxLen = kStartMaxLen;
}
}
_hash[kFixHashSize + hashValue] = _pos;
UInt32 ptr0 = (_cyclicBufferPos << 1) + 1;
UInt32 ptr1 = (_cyclicBufferPos << 1);
UInt32 len0, len1;
len0 = len1 = kNumHashDirectBytes;
if (kNumHashDirectBytes != 0)
{
if (curMatch > matchMinPos)
{
if (_bufferBase[_bufferOffset + curMatch + kNumHashDirectBytes] !=
_bufferBase[cur + kNumHashDirectBytes])
{
distances[offset++] = maxLen = kNumHashDirectBytes;
distances[offset++] = _pos - curMatch - 1;
}
}
}
UInt32 count = _cutValue;
while(true)
{
if(curMatch <= matchMinPos || count-- == 0)
{
_son[ptr0] = _son[ptr1] = kEmptyHashValue;
break;
}
UInt32 delta = _pos - curMatch;
UInt32 cyclicPos = ((delta <= _cyclicBufferPos) ?
(_cyclicBufferPos - delta) :
(_cyclicBufferPos - delta + _cyclicBufferSize)) << 1;
UInt32 pby1 = _bufferOffset + curMatch;
UInt32 len = Math.Min(len0, len1);
if (_bufferBase[pby1 + len] == _bufferBase[cur + len])
{
while(++len != lenLimit)
if (_bufferBase[pby1 + len] != _bufferBase[cur + len])
break;
if (maxLen < len)
{
distances[offset++] = maxLen = len;
distances[offset++] = delta - 1;
if (len == lenLimit)
{
_son[ptr1] = _son[cyclicPos];
_son[ptr0] = _son[cyclicPos + 1];
break;
}
}
}
if (_bufferBase[pby1 + len] < _bufferBase[cur + len])
{
_son[ptr1] = curMatch;
ptr1 = cyclicPos + 1;
curMatch = _son[ptr1];
len1 = len;
}
else
{
_son[ptr0] = curMatch;
ptr0 = cyclicPos;
curMatch = _son[ptr0];
len0 = len;
}
}
MovePos();
return offset;
}
public void Skip(UInt32 num)
{
do
{
UInt32 lenLimit;
if (_pos + _matchMaxLen <= _streamPos)
lenLimit = _matchMaxLen;
else
{
lenLimit = _streamPos - _pos;
if (lenLimit < kMinMatchCheck)
{
MovePos();
continue;
}
}
UInt32 matchMinPos = (_pos > _cyclicBufferSize) ? (_pos - _cyclicBufferSize) : 0;
UInt32 cur = _bufferOffset + _pos;
UInt32 hashValue;
if (HASH_ARRAY)
{
UInt32 temp = CRC.Table[_bufferBase[cur]] ^ _bufferBase[cur + 1];
UInt32 hash2Value = temp & (kHash2Size - 1);
_hash[hash2Value] = _pos;
temp ^= ((UInt32)(_bufferBase[cur + 2]) << 8);
UInt32 hash3Value = temp & (kHash3Size - 1);
_hash[kHash3Offset + hash3Value] = _pos;
hashValue = (temp ^ (CRC.Table[_bufferBase[cur + 3]] << 5)) & _hashMask;
}
else
hashValue = _bufferBase[cur] ^ ((UInt32)(_bufferBase[cur + 1]) << 8);
UInt32 curMatch = _hash[kFixHashSize + hashValue];
_hash[kFixHashSize + hashValue] = _pos;
UInt32 ptr0 = (_cyclicBufferPos << 1) + 1;
UInt32 ptr1 = (_cyclicBufferPos << 1);
UInt32 len0, len1;
len0 = len1 = kNumHashDirectBytes;
UInt32 count = _cutValue;
while (true)
{
if (curMatch <= matchMinPos || count-- == 0)
{
_son[ptr0] = _son[ptr1] = kEmptyHashValue;
break;
}
UInt32 delta = _pos - curMatch;
UInt32 cyclicPos = ((delta <= _cyclicBufferPos) ?
(_cyclicBufferPos - delta) :
(_cyclicBufferPos - delta + _cyclicBufferSize)) << 1;
UInt32 pby1 = _bufferOffset + curMatch;
UInt32 len = Math.Min(len0, len1);
if (_bufferBase[pby1 + len] == _bufferBase[cur + len])
{
while (++len != lenLimit)
if (_bufferBase[pby1 + len] != _bufferBase[cur + len])
break;
if (len == lenLimit)
{
_son[ptr1] = _son[cyclicPos];
_son[ptr0] = _son[cyclicPos + 1];
break;
}
}
if (_bufferBase[pby1 + len] < _bufferBase[cur + len])
{
_son[ptr1] = curMatch;
ptr1 = cyclicPos + 1;
curMatch = _son[ptr1];
len1 = len;
}
else
{
_son[ptr0] = curMatch;
ptr0 = cyclicPos;
curMatch = _son[ptr0];
len0 = len;
}
}
MovePos();
}
while (--num != 0);
}
void NormalizeLinks(UInt32[] items, UInt32 numItems, UInt32 subValue)
{
for (UInt32 i = 0; i < numItems; i++)
{
UInt32 value = items[i];
if (value <= subValue)
value = kEmptyHashValue;
else
value -= subValue;
items[i] = value;
}
}
void Normalize()
{
UInt32 subValue = _pos - _cyclicBufferSize;
NormalizeLinks(_son, _cyclicBufferSize * 2, subValue);
NormalizeLinks(_hash, _hashSizeSum, subValue);
ReduceOffsets((Int32)subValue);
}
public void SetCutValue(UInt32 cutValue) { _cutValue = cutValue; }
}
}

View File

@@ -0,0 +1,132 @@
// LzInWindow.cs
using System;
namespace SevenZip.Compression.LZ
{
public class InWindow
{
public Byte[] _bufferBase = null; // pointer to buffer with data
System.IO.Stream _stream;
UInt32 _posLimit; // offset (from _buffer) of first byte when new block reading must be done
bool _streamEndWasReached; // if (true) then _streamPos shows real end of stream
UInt32 _pointerToLastSafePosition;
public UInt32 _bufferOffset;
public UInt32 _blockSize; // Size of Allocated memory block
public UInt32 _pos; // offset (from _buffer) of curent byte
UInt32 _keepSizeBefore; // how many BYTEs must be kept in buffer before _pos
UInt32 _keepSizeAfter; // how many BYTEs must be kept buffer after _pos
public UInt32 _streamPos; // offset (from _buffer) of first not read byte from Stream
public void MoveBlock()
{
UInt32 offset = (UInt32)(_bufferOffset) + _pos - _keepSizeBefore;
// we need one additional byte, since MovePos moves on 1 byte.
if (offset > 0)
offset--;
UInt32 numBytes = (UInt32)(_bufferOffset) + _streamPos - offset;
// check negative offset ????
for (UInt32 i = 0; i < numBytes; i++)
_bufferBase[i] = _bufferBase[offset + i];
_bufferOffset -= offset;
}
public virtual void ReadBlock()
{
if (_streamEndWasReached)
return;
while (true)
{
int size = (int)((0 - _bufferOffset) + _blockSize - _streamPos);
if (size == 0)
return;
int numReadBytes = _stream.Read(_bufferBase, (int)(_bufferOffset + _streamPos), size);
if (numReadBytes == 0)
{
_posLimit = _streamPos;
UInt32 pointerToPostion = _bufferOffset + _posLimit;
if (pointerToPostion > _pointerToLastSafePosition)
_posLimit = (UInt32)(_pointerToLastSafePosition - _bufferOffset);
_streamEndWasReached = true;
return;
}
_streamPos += (UInt32)numReadBytes;
if (_streamPos >= _pos + _keepSizeAfter)
_posLimit = _streamPos - _keepSizeAfter;
}
}
void Free() { _bufferBase = null; }
public void Create(UInt32 keepSizeBefore, UInt32 keepSizeAfter, UInt32 keepSizeReserv)
{
_keepSizeBefore = keepSizeBefore;
_keepSizeAfter = keepSizeAfter;
UInt32 blockSize = keepSizeBefore + keepSizeAfter + keepSizeReserv;
if (_bufferBase == null || _blockSize != blockSize)
{
Free();
_blockSize = blockSize;
_bufferBase = new Byte[_blockSize];
}
_pointerToLastSafePosition = _blockSize - keepSizeAfter;
}
public void SetStream(System.IO.Stream stream) { _stream = stream; }
public void ReleaseStream() { _stream = null; }
public void Init()
{
_bufferOffset = 0;
_pos = 0;
_streamPos = 0;
_streamEndWasReached = false;
ReadBlock();
}
public void MovePos()
{
_pos++;
if (_pos > _posLimit)
{
UInt32 pointerToPostion = _bufferOffset + _pos;
if (pointerToPostion > _pointerToLastSafePosition)
MoveBlock();
ReadBlock();
}
}
public Byte GetIndexByte(Int32 index) { return _bufferBase[_bufferOffset + _pos + index]; }
// index + limit have not to exceed _keepSizeAfter;
public UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit)
{
if (_streamEndWasReached)
if ((_pos + index) + limit > _streamPos)
limit = _streamPos - (UInt32)(_pos + index);
distance++;
// Byte *pby = _buffer + (size_t)_pos + index;
UInt32 pby = _bufferOffset + _pos + (UInt32)index;
UInt32 i;
for (i = 0; i < limit && _bufferBase[pby + i] == _bufferBase[pby + i - distance]; i++);
return i;
}
public UInt32 GetNumAvailableBytes() { return _streamPos - _pos; }
public void ReduceOffsets(Int32 subValue)
{
_bufferOffset += (UInt32)subValue;
_posLimit -= (UInt32)subValue;
_pos -= (UInt32)subValue;
_streamPos -= (UInt32)subValue;
}
}
}

View File

@@ -0,0 +1,110 @@
// LzOutWindow.cs
namespace SevenZip.Compression.LZ
{
public class OutWindow
{
byte[] _buffer = null;
uint _pos;
uint _windowSize = 0;
uint _streamPos;
System.IO.Stream _stream;
public uint TrainSize = 0;
public void Create(uint windowSize)
{
if (_windowSize != windowSize)
{
// System.GC.Collect();
_buffer = new byte[windowSize];
}
_windowSize = windowSize;
_pos = 0;
_streamPos = 0;
}
public void Init(System.IO.Stream stream, bool solid)
{
ReleaseStream();
_stream = stream;
if (!solid)
{
_streamPos = 0;
_pos = 0;
TrainSize = 0;
}
}
public bool Train(System.IO.Stream stream)
{
long len = stream.Length;
uint size = (len < _windowSize) ? (uint)len : _windowSize;
TrainSize = size;
stream.Position = len - size;
_streamPos = _pos = 0;
while (size > 0)
{
uint curSize = _windowSize - _pos;
if (size < curSize)
curSize = size;
int numReadBytes = stream.Read(_buffer, (int)_pos, (int)curSize);
if (numReadBytes == 0)
return false;
size -= (uint)numReadBytes;
_pos += (uint)numReadBytes;
_streamPos += (uint)numReadBytes;
if (_pos == _windowSize)
_streamPos = _pos = 0;
}
return true;
}
public void ReleaseStream()
{
Flush();
_stream = null;
}
public void Flush()
{
uint size = _pos - _streamPos;
if (size == 0)
return;
_stream.Write(_buffer, (int)_streamPos, (int)size);
if (_pos >= _windowSize)
_pos = 0;
_streamPos = _pos;
}
public void CopyBlock(uint distance, uint len)
{
uint pos = _pos - distance - 1;
if (pos >= _windowSize)
pos += _windowSize;
for (; len > 0; len--)
{
if (pos >= _windowSize)
pos = 0;
_buffer[_pos++] = _buffer[pos++];
if (_pos >= _windowSize)
Flush();
}
}
public void PutByte(byte b)
{
_buffer[_pos++] = b;
if (_pos >= _windowSize)
Flush();
}
public byte GetByte(uint distance)
{
uint pos = _pos - distance - 1;
if (pos >= _windowSize)
pos += _windowSize;
return _buffer[pos];
}
}
}

View File

@@ -0,0 +1,76 @@
// LzmaBase.cs
namespace SevenZip.Compression.LZMA
{
internal abstract class Base
{
public const uint kNumRepDistances = 4;
public const uint kNumStates = 12;
// static byte []kLiteralNextStates = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5};
// static byte []kMatchNextStates = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10};
// static byte []kRepNextStates = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11};
// static byte []kShortRepNextStates = {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11};
public struct State
{
public uint Index;
public void Init() { Index = 0; }
public void UpdateChar()
{
if (Index < 4) Index = 0;
else if (Index < 10) Index -= 3;
else Index -= 6;
}
public void UpdateMatch() { Index = (uint)(Index < 7 ? 7 : 10); }
public void UpdateRep() { Index = (uint)(Index < 7 ? 8 : 11); }
public void UpdateShortRep() { Index = (uint)(Index < 7 ? 9 : 11); }
public bool IsCharState() { return Index < 7; }
}
public const int kNumPosSlotBits = 6;
public const int kDicLogSizeMin = 0;
// public const int kDicLogSizeMax = 30;
// public const uint kDistTableSizeMax = kDicLogSizeMax * 2;
public const int kNumLenToPosStatesBits = 2; // it's for speed optimization
public const uint kNumLenToPosStates = 1 << kNumLenToPosStatesBits;
public const uint kMatchMinLen = 2;
public static uint GetLenToPosState(uint len)
{
len -= kMatchMinLen;
if (len < kNumLenToPosStates)
return len;
return (uint)(kNumLenToPosStates - 1);
}
public const int kNumAlignBits = 4;
public const uint kAlignTableSize = 1 << kNumAlignBits;
public const uint kAlignMask = (kAlignTableSize - 1);
public const uint kStartPosModelIndex = 4;
public const uint kEndPosModelIndex = 14;
public const uint kNumPosModels = kEndPosModelIndex - kStartPosModelIndex;
public const uint kNumFullDistances = 1 << ((int)kEndPosModelIndex / 2);
public const uint kNumLitPosStatesBitsEncodingMax = 4;
public const uint kNumLitContextBitsMax = 8;
public const int kNumPosStatesBitsMax = 4;
public const uint kNumPosStatesMax = (1 << kNumPosStatesBitsMax);
public const int kNumPosStatesBitsEncodingMax = 4;
public const uint kNumPosStatesEncodingMax = (1 << kNumPosStatesBitsEncodingMax);
public const int kNumLowLenBits = 3;
public const int kNumMidLenBits = 3;
public const int kNumHighLenBits = 8;
public const uint kNumLowLenSymbols = 1 << kNumLowLenBits;
public const uint kNumMidLenSymbols = 1 << kNumMidLenBits;
public const uint kNumLenSymbols = kNumLowLenSymbols + kNumMidLenSymbols +
(1 << kNumHighLenBits);
public const uint kMatchMaxLen = kMatchMinLen + kNumLenSymbols - 1;
}
}

View File

@@ -0,0 +1,398 @@
// LzmaDecoder.cs
using System;
namespace SevenZip.Compression.LZMA
{
using RangeCoder;
public class Decoder : ICoder, ISetDecoderProperties // ,System.IO.Stream
{
class LenDecoder
{
BitDecoder m_Choice = new BitDecoder();
BitDecoder m_Choice2 = new BitDecoder();
BitTreeDecoder[] m_LowCoder = new BitTreeDecoder[Base.kNumPosStatesMax];
BitTreeDecoder[] m_MidCoder = new BitTreeDecoder[Base.kNumPosStatesMax];
BitTreeDecoder m_HighCoder = new BitTreeDecoder(Base.kNumHighLenBits);
uint m_NumPosStates = 0;
public void Create(uint numPosStates)
{
for (uint posState = m_NumPosStates; posState < numPosStates; posState++)
{
m_LowCoder[posState] = new BitTreeDecoder(Base.kNumLowLenBits);
m_MidCoder[posState] = new BitTreeDecoder(Base.kNumMidLenBits);
}
m_NumPosStates = numPosStates;
}
public void Init()
{
m_Choice.Init();
for (uint posState = 0; posState < m_NumPosStates; posState++)
{
m_LowCoder[posState].Init();
m_MidCoder[posState].Init();
}
m_Choice2.Init();
m_HighCoder.Init();
}
public uint Decode(RangeCoder.Decoder rangeDecoder, uint posState)
{
if (m_Choice.Decode(rangeDecoder) == 0)
return m_LowCoder[posState].Decode(rangeDecoder);
else
{
uint symbol = Base.kNumLowLenSymbols;
if (m_Choice2.Decode(rangeDecoder) == 0)
symbol += m_MidCoder[posState].Decode(rangeDecoder);
else
{
symbol += Base.kNumMidLenSymbols;
symbol += m_HighCoder.Decode(rangeDecoder);
}
return symbol;
}
}
}
class LiteralDecoder
{
struct Decoder2
{
BitDecoder[] m_Decoders;
public void Create() { m_Decoders = new BitDecoder[0x300]; }
public void Init() { for (int i = 0; i < 0x300; i++) m_Decoders[i].Init(); }
public byte DecodeNormal(RangeCoder.Decoder rangeDecoder)
{
uint symbol = 1;
do
symbol = (symbol << 1) | m_Decoders[symbol].Decode(rangeDecoder);
while (symbol < 0x100);
return (byte)symbol;
}
public byte DecodeWithMatchByte(RangeCoder.Decoder rangeDecoder, byte matchByte)
{
uint symbol = 1;
do
{
uint matchBit = (uint)(matchByte >> 7) & 1;
matchByte <<= 1;
uint bit = m_Decoders[((1 + matchBit) << 8) + symbol].Decode(rangeDecoder);
symbol = (symbol << 1) | bit;
if (matchBit != bit)
{
while (symbol < 0x100)
symbol = (symbol << 1) | m_Decoders[symbol].Decode(rangeDecoder);
break;
}
}
while (symbol < 0x100);
return (byte)symbol;
}
}
Decoder2[] m_Coders;
int m_NumPrevBits;
int m_NumPosBits;
uint m_PosMask;
public void Create(int numPosBits, int numPrevBits)
{
if (m_Coders != null && m_NumPrevBits == numPrevBits &&
m_NumPosBits == numPosBits)
return;
m_NumPosBits = numPosBits;
m_PosMask = ((uint)1 << numPosBits) - 1;
m_NumPrevBits = numPrevBits;
uint numStates = (uint)1 << (m_NumPrevBits + m_NumPosBits);
m_Coders = new Decoder2[numStates];
for (uint i = 0; i < numStates; i++)
m_Coders[i].Create();
}
public void Init()
{
uint numStates = (uint)1 << (m_NumPrevBits + m_NumPosBits);
for (uint i = 0; i < numStates; i++)
m_Coders[i].Init();
}
uint GetState(uint pos, byte prevByte)
{ return ((pos & m_PosMask) << m_NumPrevBits) + (uint)(prevByte >> (8 - m_NumPrevBits)); }
public byte DecodeNormal(RangeCoder.Decoder rangeDecoder, uint pos, byte prevByte)
{ return m_Coders[GetState(pos, prevByte)].DecodeNormal(rangeDecoder); }
public byte DecodeWithMatchByte(RangeCoder.Decoder rangeDecoder, uint pos, byte prevByte, byte matchByte)
{ return m_Coders[GetState(pos, prevByte)].DecodeWithMatchByte(rangeDecoder, matchByte); }
};
LZ.OutWindow m_OutWindow = new LZ.OutWindow();
RangeCoder.Decoder m_RangeDecoder = new RangeCoder.Decoder();
BitDecoder[] m_IsMatchDecoders = new BitDecoder[Base.kNumStates << Base.kNumPosStatesBitsMax];
BitDecoder[] m_IsRepDecoders = new BitDecoder[Base.kNumStates];
BitDecoder[] m_IsRepG0Decoders = new BitDecoder[Base.kNumStates];
BitDecoder[] m_IsRepG1Decoders = new BitDecoder[Base.kNumStates];
BitDecoder[] m_IsRepG2Decoders = new BitDecoder[Base.kNumStates];
BitDecoder[] m_IsRep0LongDecoders = new BitDecoder[Base.kNumStates << Base.kNumPosStatesBitsMax];
BitTreeDecoder[] m_PosSlotDecoder = new BitTreeDecoder[Base.kNumLenToPosStates];
BitDecoder[] m_PosDecoders = new BitDecoder[Base.kNumFullDistances - Base.kEndPosModelIndex];
BitTreeDecoder m_PosAlignDecoder = new BitTreeDecoder(Base.kNumAlignBits);
LenDecoder m_LenDecoder = new LenDecoder();
LenDecoder m_RepLenDecoder = new LenDecoder();
LiteralDecoder m_LiteralDecoder = new LiteralDecoder();
uint m_DictionarySize;
uint m_DictionarySizeCheck;
uint m_PosStateMask;
public Decoder()
{
m_DictionarySize = 0xFFFFFFFF;
for (int i = 0; i < Base.kNumLenToPosStates; i++)
m_PosSlotDecoder[i] = new BitTreeDecoder(Base.kNumPosSlotBits);
}
void SetDictionarySize(uint dictionarySize)
{
if (m_DictionarySize != dictionarySize)
{
m_DictionarySize = dictionarySize;
m_DictionarySizeCheck = Math.Max(m_DictionarySize, 1);
uint blockSize = Math.Max(m_DictionarySizeCheck, (1 << 12));
m_OutWindow.Create(blockSize);
}
}
void SetLiteralProperties(int lp, int lc)
{
if (lp > 8)
throw new InvalidParamException();
if (lc > 8)
throw new InvalidParamException();
m_LiteralDecoder.Create(lp, lc);
}
void SetPosBitsProperties(int pb)
{
if (pb > Base.kNumPosStatesBitsMax)
throw new InvalidParamException();
uint numPosStates = (uint)1 << pb;
m_LenDecoder.Create(numPosStates);
m_RepLenDecoder.Create(numPosStates);
m_PosStateMask = numPosStates - 1;
}
bool _solid = false;
void Init(System.IO.Stream inStream, System.IO.Stream outStream)
{
m_RangeDecoder.Init(inStream);
m_OutWindow.Init(outStream, _solid);
uint i;
for (i = 0; i < Base.kNumStates; i++)
{
for (uint j = 0; j <= m_PosStateMask; j++)
{
uint index = (i << Base.kNumPosStatesBitsMax) + j;
m_IsMatchDecoders[index].Init();
m_IsRep0LongDecoders[index].Init();
}
m_IsRepDecoders[i].Init();
m_IsRepG0Decoders[i].Init();
m_IsRepG1Decoders[i].Init();
m_IsRepG2Decoders[i].Init();
}
m_LiteralDecoder.Init();
for (i = 0; i < Base.kNumLenToPosStates; i++)
m_PosSlotDecoder[i].Init();
// m_PosSpecDecoder.Init();
for (i = 0; i < Base.kNumFullDistances - Base.kEndPosModelIndex; i++)
m_PosDecoders[i].Init();
m_LenDecoder.Init();
m_RepLenDecoder.Init();
m_PosAlignDecoder.Init();
}
public void Code(System.IO.Stream inStream, System.IO.Stream outStream,
Int64 inSize, Int64 outSize, ICodeProgress progress)
{
Init(inStream, outStream);
Base.State state = new Base.State();
state.Init();
uint rep0 = 0, rep1 = 0, rep2 = 0, rep3 = 0;
UInt64 nowPos64 = 0;
UInt64 outSize64 = (UInt64)outSize;
if (nowPos64 < outSize64)
{
if (m_IsMatchDecoders[state.Index << Base.kNumPosStatesBitsMax].Decode(m_RangeDecoder) != 0)
throw new DataErrorException();
state.UpdateChar();
byte b = m_LiteralDecoder.DecodeNormal(m_RangeDecoder, 0, 0);
m_OutWindow.PutByte(b);
nowPos64++;
}
while (nowPos64 < outSize64)
{
// UInt64 next = Math.Min(nowPos64 + (1 << 18), outSize64);
// while(nowPos64 < next)
{
uint posState = (uint)nowPos64 & m_PosStateMask;
if (m_IsMatchDecoders[(state.Index << Base.kNumPosStatesBitsMax) + posState].Decode(m_RangeDecoder) == 0)
{
byte b;
byte prevByte = m_OutWindow.GetByte(0);
if (!state.IsCharState())
b = m_LiteralDecoder.DecodeWithMatchByte(m_RangeDecoder,
(uint)nowPos64, prevByte, m_OutWindow.GetByte(rep0));
else
b = m_LiteralDecoder.DecodeNormal(m_RangeDecoder, (uint)nowPos64, prevByte);
m_OutWindow.PutByte(b);
state.UpdateChar();
nowPos64++;
}
else
{
uint len;
if (m_IsRepDecoders[state.Index].Decode(m_RangeDecoder) == 1)
{
if (m_IsRepG0Decoders[state.Index].Decode(m_RangeDecoder) == 0)
{
if (m_IsRep0LongDecoders[(state.Index << Base.kNumPosStatesBitsMax) + posState].Decode(m_RangeDecoder) == 0)
{
state.UpdateShortRep();
m_OutWindow.PutByte(m_OutWindow.GetByte(rep0));
nowPos64++;
continue;
}
}
else
{
UInt32 distance;
if (m_IsRepG1Decoders[state.Index].Decode(m_RangeDecoder) == 0)
{
distance = rep1;
}
else
{
if (m_IsRepG2Decoders[state.Index].Decode(m_RangeDecoder) == 0)
distance = rep2;
else
{
distance = rep3;
rep3 = rep2;
}
rep2 = rep1;
}
rep1 = rep0;
rep0 = distance;
}
len = m_RepLenDecoder.Decode(m_RangeDecoder, posState) + Base.kMatchMinLen;
state.UpdateRep();
}
else
{
rep3 = rep2;
rep2 = rep1;
rep1 = rep0;
len = Base.kMatchMinLen + m_LenDecoder.Decode(m_RangeDecoder, posState);
state.UpdateMatch();
uint posSlot = m_PosSlotDecoder[Base.GetLenToPosState(len)].Decode(m_RangeDecoder);
if (posSlot >= Base.kStartPosModelIndex)
{
int numDirectBits = (int)((posSlot >> 1) - 1);
rep0 = ((2 | (posSlot & 1)) << numDirectBits);
if (posSlot < Base.kEndPosModelIndex)
rep0 += BitTreeDecoder.ReverseDecode(m_PosDecoders,
rep0 - posSlot - 1, m_RangeDecoder, numDirectBits);
else
{
rep0 += (m_RangeDecoder.DecodeDirectBits(
numDirectBits - Base.kNumAlignBits) << Base.kNumAlignBits);
rep0 += m_PosAlignDecoder.ReverseDecode(m_RangeDecoder);
}
}
else
rep0 = posSlot;
}
if (rep0 >= m_OutWindow.TrainSize + nowPos64 || rep0 >= m_DictionarySizeCheck)
{
if (rep0 == 0xFFFFFFFF)
break;
throw new DataErrorException();
}
m_OutWindow.CopyBlock(rep0, len);
nowPos64 += len;
}
}
}
m_OutWindow.Flush();
m_OutWindow.ReleaseStream();
m_RangeDecoder.ReleaseStream();
}
public void SetDecoderProperties(byte[] properties)
{
if (properties.Length < 5)
throw new InvalidParamException();
int lc = properties[0] % 9;
int remainder = properties[0] / 9;
int lp = remainder % 5;
int pb = remainder / 5;
if (pb > Base.kNumPosStatesBitsMax)
throw new InvalidParamException();
UInt32 dictionarySize = 0;
for (int i = 0; i < 4; i++)
dictionarySize += ((UInt32)(properties[1 + i])) << (i * 8);
SetDictionarySize(dictionarySize);
SetLiteralProperties(lp, lc);
SetPosBitsProperties(pb);
}
public bool Train(System.IO.Stream stream)
{
_solid = true;
return m_OutWindow.Train(stream);
}
/*
public override bool CanRead { get { return true; }}
public override bool CanWrite { get { return true; }}
public override bool CanSeek { get { return true; }}
public override long Length { get { return 0; }}
public override long Position
{
get { return 0; }
set { }
}
public override void Flush() { }
public override int Read(byte[] buffer, int offset, int count)
{
return 0;
}
public override void Write(byte[] buffer, int offset, int count)
{
}
public override long Seek(long offset, System.IO.SeekOrigin origin)
{
return 0;
}
public override void SetLength(long value) {}
*/
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,234 @@
using System;
namespace SevenZip.Compression.RangeCoder
{
class Encoder
{
public const uint kTopValue = (1 << 24);
System.IO.Stream Stream;
public UInt64 Low;
public uint Range;
uint _cacheSize;
byte _cache;
long StartPosition;
public void SetStream(System.IO.Stream stream)
{
Stream = stream;
}
public void ReleaseStream()
{
Stream = null;
}
public void Init()
{
StartPosition = Stream.Position;
Low = 0;
Range = 0xFFFFFFFF;
_cacheSize = 1;
_cache = 0;
}
public void FlushData()
{
for (int i = 0; i < 5; i++)
ShiftLow();
}
public void FlushStream()
{
Stream.Flush();
}
public void CloseStream()
{
Stream.Close();
}
public void Encode(uint start, uint size, uint total)
{
Low += start * (Range /= total);
Range *= size;
while (Range < kTopValue)
{
Range <<= 8;
ShiftLow();
}
}
public void ShiftLow()
{
if ((uint)Low < (uint)0xFF000000 || (uint)(Low >> 32) == 1)
{
byte temp = _cache;
do
{
Stream.WriteByte((byte)(temp + (Low >> 32)));
temp = 0xFF;
}
while (--_cacheSize != 0);
_cache = (byte)(((uint)Low) >> 24);
}
_cacheSize++;
Low = ((uint)Low) << 8;
}
public void EncodeDirectBits(uint v, int numTotalBits)
{
for (int i = numTotalBits - 1; i >= 0; i--)
{
Range >>= 1;
if (((v >> i) & 1) == 1)
Low += Range;
if (Range < kTopValue)
{
Range <<= 8;
ShiftLow();
}
}
}
public void EncodeBit(uint size0, int numTotalBits, uint symbol)
{
uint newBound = (Range >> numTotalBits) * size0;
if (symbol == 0)
Range = newBound;
else
{
Low += newBound;
Range -= newBound;
}
while (Range < kTopValue)
{
Range <<= 8;
ShiftLow();
}
}
public long GetProcessedSizeAdd()
{
return _cacheSize +
Stream.Position - StartPosition + 4;
// (long)Stream.GetProcessedSize();
}
}
class Decoder
{
public const uint kTopValue = (1 << 24);
public uint Range;
public uint Code;
// public Buffer.InBuffer Stream = new Buffer.InBuffer(1 << 16);
public System.IO.Stream Stream;
public void Init(System.IO.Stream stream)
{
// Stream.Init(stream);
Stream = stream;
Code = 0;
Range = 0xFFFFFFFF;
for (int i = 0; i < 5; i++)
Code = (Code << 8) | (byte)Stream.ReadByte();
}
public void ReleaseStream()
{
// Stream.ReleaseStream();
Stream = null;
}
public void CloseStream()
{
Stream.Close();
}
public void Normalize()
{
while (Range < kTopValue)
{
Code = (Code << 8) | (byte)Stream.ReadByte();
Range <<= 8;
}
}
public void Normalize2()
{
if (Range < kTopValue)
{
Code = (Code << 8) | (byte)Stream.ReadByte();
Range <<= 8;
}
}
public uint GetThreshold(uint total)
{
return Code / (Range /= total);
}
public void Decode(uint start, uint size, uint total)
{
Code -= start * Range;
Range *= size;
Normalize();
}
public uint DecodeDirectBits(int numTotalBits)
{
uint range = Range;
uint code = Code;
uint result = 0;
for (int i = numTotalBits; i > 0; i--)
{
range >>= 1;
/*
result <<= 1;
if (code >= range)
{
code -= range;
result |= 1;
}
*/
uint t = (code - range) >> 31;
code -= range & (t - 1);
result = (result << 1) | (1 - t);
if (range < kTopValue)
{
code = (code << 8) | (byte)Stream.ReadByte();
range <<= 8;
}
}
Range = range;
Code = code;
return result;
}
public uint DecodeBit(uint size0, int numTotalBits)
{
uint newBound = (Range >> numTotalBits) * size0;
uint symbol;
if (Code < newBound)
{
symbol = 0;
Range = newBound;
}
else
{
symbol = 1;
Code -= newBound;
Range -= newBound;
}
Normalize();
return symbol;
}
// ulong GetProcessedSize() {return Stream.GetProcessedSize(); }
}
}

View File

@@ -0,0 +1,117 @@
using System;
namespace SevenZip.Compression.RangeCoder
{
struct BitEncoder
{
public const int kNumBitModelTotalBits = 11;
public const uint kBitModelTotal = (1 << kNumBitModelTotalBits);
const int kNumMoveBits = 5;
const int kNumMoveReducingBits = 2;
public const int kNumBitPriceShiftBits = 6;
uint Prob;
public void Init() { Prob = kBitModelTotal >> 1; }
public void UpdateModel(uint symbol)
{
if (symbol == 0)
Prob += (kBitModelTotal - Prob) >> kNumMoveBits;
else
Prob -= (Prob) >> kNumMoveBits;
}
public void Encode(Encoder encoder, uint symbol)
{
// encoder.EncodeBit(Prob, kNumBitModelTotalBits, symbol);
// UpdateModel(symbol);
uint newBound = (encoder.Range >> kNumBitModelTotalBits) * Prob;
if (symbol == 0)
{
encoder.Range = newBound;
Prob += (kBitModelTotal - Prob) >> kNumMoveBits;
}
else
{
encoder.Low += newBound;
encoder.Range -= newBound;
Prob -= (Prob) >> kNumMoveBits;
}
if (encoder.Range < Encoder.kTopValue)
{
encoder.Range <<= 8;
encoder.ShiftLow();
}
}
private static UInt32[] ProbPrices = new UInt32[kBitModelTotal >> kNumMoveReducingBits];
static BitEncoder()
{
const int kNumBits = (kNumBitModelTotalBits - kNumMoveReducingBits);
for (int i = kNumBits - 1; i >= 0; i--)
{
UInt32 start = (UInt32)1 << (kNumBits - i - 1);
UInt32 end = (UInt32)1 << (kNumBits - i);
for (UInt32 j = start; j < end; j++)
ProbPrices[j] = ((UInt32)i << kNumBitPriceShiftBits) +
(((end - j) << kNumBitPriceShiftBits) >> (kNumBits - i - 1));
}
}
public uint GetPrice(uint symbol)
{
return ProbPrices[(((Prob - symbol) ^ ((-(int)symbol))) & (kBitModelTotal - 1)) >> kNumMoveReducingBits];
}
public uint GetPrice0() { return ProbPrices[Prob >> kNumMoveReducingBits]; }
public uint GetPrice1() { return ProbPrices[(kBitModelTotal - Prob) >> kNumMoveReducingBits]; }
}
struct BitDecoder
{
public const int kNumBitModelTotalBits = 11;
public const uint kBitModelTotal = (1 << kNumBitModelTotalBits);
const int kNumMoveBits = 5;
uint Prob;
public void UpdateModel(int numMoveBits, uint symbol)
{
if (symbol == 0)
Prob += (kBitModelTotal - Prob) >> numMoveBits;
else
Prob -= (Prob) >> numMoveBits;
}
public void Init() { Prob = kBitModelTotal >> 1; }
public uint Decode(RangeCoder.Decoder rangeDecoder)
{
uint newBound = (uint)(rangeDecoder.Range >> kNumBitModelTotalBits) * (uint)Prob;
if (rangeDecoder.Code < newBound)
{
rangeDecoder.Range = newBound;
Prob += (kBitModelTotal - Prob) >> kNumMoveBits;
if (rangeDecoder.Range < Decoder.kTopValue)
{
rangeDecoder.Code = (rangeDecoder.Code << 8) | (byte)rangeDecoder.Stream.ReadByte();
rangeDecoder.Range <<= 8;
}
return 0;
}
else
{
rangeDecoder.Range -= newBound;
rangeDecoder.Code -= newBound;
Prob -= (Prob) >> kNumMoveBits;
if (rangeDecoder.Range < Decoder.kTopValue)
{
rangeDecoder.Code = (rangeDecoder.Code << 8) | (byte)rangeDecoder.Stream.ReadByte();
rangeDecoder.Range <<= 8;
}
return 1;
}
}
}
}

View File

@@ -0,0 +1,157 @@
using System;
namespace SevenZip.Compression.RangeCoder
{
struct BitTreeEncoder
{
BitEncoder[] Models;
int NumBitLevels;
public BitTreeEncoder(int numBitLevels)
{
NumBitLevels = numBitLevels;
Models = new BitEncoder[1 << numBitLevels];
}
public void Init()
{
for (uint i = 1; i < (1 << NumBitLevels); i++)
Models[i].Init();
}
public void Encode(Encoder rangeEncoder, UInt32 symbol)
{
UInt32 m = 1;
for (int bitIndex = NumBitLevels; bitIndex > 0; )
{
bitIndex--;
UInt32 bit = (symbol >> bitIndex) & 1;
Models[m].Encode(rangeEncoder, bit);
m = (m << 1) | bit;
}
}
public void ReverseEncode(Encoder rangeEncoder, UInt32 symbol)
{
UInt32 m = 1;
for (UInt32 i = 0; i < NumBitLevels; i++)
{
UInt32 bit = symbol & 1;
Models[m].Encode(rangeEncoder, bit);
m = (m << 1) | bit;
symbol >>= 1;
}
}
public UInt32 GetPrice(UInt32 symbol)
{
UInt32 price = 0;
UInt32 m = 1;
for (int bitIndex = NumBitLevels; bitIndex > 0; )
{
bitIndex--;
UInt32 bit = (symbol >> bitIndex) & 1;
price += Models[m].GetPrice(bit);
m = (m << 1) + bit;
}
return price;
}
public UInt32 ReverseGetPrice(UInt32 symbol)
{
UInt32 price = 0;
UInt32 m = 1;
for (int i = NumBitLevels; i > 0; i--)
{
UInt32 bit = symbol & 1;
symbol >>= 1;
price += Models[m].GetPrice(bit);
m = (m << 1) | bit;
}
return price;
}
public static UInt32 ReverseGetPrice(BitEncoder[] Models, UInt32 startIndex,
int NumBitLevels, UInt32 symbol)
{
UInt32 price = 0;
UInt32 m = 1;
for (int i = NumBitLevels; i > 0; i--)
{
UInt32 bit = symbol & 1;
symbol >>= 1;
price += Models[startIndex + m].GetPrice(bit);
m = (m << 1) | bit;
}
return price;
}
public static void ReverseEncode(BitEncoder[] Models, UInt32 startIndex,
Encoder rangeEncoder, int NumBitLevels, UInt32 symbol)
{
UInt32 m = 1;
for (int i = 0; i < NumBitLevels; i++)
{
UInt32 bit = symbol & 1;
Models[startIndex + m].Encode(rangeEncoder, bit);
m = (m << 1) | bit;
symbol >>= 1;
}
}
}
struct BitTreeDecoder
{
BitDecoder[] Models;
int NumBitLevels;
public BitTreeDecoder(int numBitLevels)
{
NumBitLevels = numBitLevels;
Models = new BitDecoder[1 << numBitLevels];
}
public void Init()
{
for (uint i = 1; i < (1 << NumBitLevels); i++)
Models[i].Init();
}
public uint Decode(RangeCoder.Decoder rangeDecoder)
{
uint m = 1;
for (int bitIndex = NumBitLevels; bitIndex > 0; bitIndex--)
m = (m << 1) + Models[m].Decode(rangeDecoder);
return m - ((uint)1 << NumBitLevels);
}
public uint ReverseDecode(RangeCoder.Decoder rangeDecoder)
{
uint m = 1;
uint symbol = 0;
for (int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++)
{
uint bit = Models[m].Decode(rangeDecoder);
m <<= 1;
m += bit;
symbol |= (bit << bitIndex);
}
return symbol;
}
public static uint ReverseDecode(BitDecoder[] Models, UInt32 startIndex,
RangeCoder.Decoder rangeDecoder, int NumBitLevels)
{
uint m = 1;
uint symbol = 0;
for (int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++)
{
uint bit = Models[startIndex + m].Decode(rangeDecoder);
m <<= 1;
m += bit;
symbol |= (bit << bitIndex);
}
return symbol;
}
}
}

157
UnityStudio/7zip/ICoder.cs Normal file
View File

@@ -0,0 +1,157 @@
// ICoder.h
using System;
namespace SevenZip
{
/// <summary>
/// The exception that is thrown when an error in input stream occurs during decoding.
/// </summary>
class DataErrorException : ApplicationException
{
public DataErrorException(): base("Data Error") { }
}
/// <summary>
/// The exception that is thrown when the value of an argument is outside the allowable range.
/// </summary>
class InvalidParamException : ApplicationException
{
public InvalidParamException(): base("Invalid Parameter") { }
}
public interface ICodeProgress
{
/// <summary>
/// Callback progress.
/// </summary>
/// <param name="inSize">
/// input size. -1 if unknown.
/// </param>
/// <param name="outSize">
/// output size. -1 if unknown.
/// </param>
void SetProgress(Int64 inSize, Int64 outSize);
};
public interface ICoder
{
/// <summary>
/// Codes streams.
/// </summary>
/// <param name="inStream">
/// input Stream.
/// </param>
/// <param name="outStream">
/// output Stream.
/// </param>
/// <param name="inSize">
/// input Size. -1 if unknown.
/// </param>
/// <param name="outSize">
/// output Size. -1 if unknown.
/// </param>
/// <param name="progress">
/// callback progress reference.
/// </param>
/// <exception cref="SevenZip.DataErrorException">
/// if input stream is not valid
/// </exception>
void Code(System.IO.Stream inStream, System.IO.Stream outStream,
Int64 inSize, Int64 outSize, ICodeProgress progress);
};
/*
public interface ICoder2
{
void Code(ISequentialInStream []inStreams,
const UInt64 []inSizes,
ISequentialOutStream []outStreams,
UInt64 []outSizes,
ICodeProgress progress);
};
*/
/// <summary>
/// Provides the fields that represent properties idenitifiers for compressing.
/// </summary>
public enum CoderPropID
{
/// <summary>
/// Specifies default property.
/// </summary>
DefaultProp = 0,
/// <summary>
/// Specifies size of dictionary.
/// </summary>
DictionarySize,
/// <summary>
/// Specifies size of memory for PPM*.
/// </summary>
UsedMemorySize,
/// <summary>
/// Specifies order for PPM methods.
/// </summary>
Order,
/// <summary>
/// Specifies Block Size.
/// </summary>
BlockSize,
/// <summary>
/// Specifies number of postion state bits for LZMA (0 <= x <= 4).
/// </summary>
PosStateBits,
/// <summary>
/// Specifies number of literal context bits for LZMA (0 <= x <= 8).
/// </summary>
LitContextBits,
/// <summary>
/// Specifies number of literal position bits for LZMA (0 <= x <= 4).
/// </summary>
LitPosBits,
/// <summary>
/// Specifies number of fast bytes for LZ*.
/// </summary>
NumFastBytes,
/// <summary>
/// Specifies match finder. LZMA: "BT2", "BT4" or "BT4B".
/// </summary>
MatchFinder,
/// <summary>
/// Specifies the number of match finder cyckes.
/// </summary>
MatchFinderCycles,
/// <summary>
/// Specifies number of passes.
/// </summary>
NumPasses,
/// <summary>
/// Specifies number of algorithm.
/// </summary>
Algorithm,
/// <summary>
/// Specifies the number of threads.
/// </summary>
NumThreads,
/// <summary>
/// Specifies mode with end marker.
/// </summary>
EndMarker
};
public interface ISetCoderProperties
{
void SetCoderProperties(CoderPropID[] propIDs, object[] properties);
};
public interface IWriteCoderProperties
{
void WriteCoderProperties(System.IO.Stream outStream);
}
public interface ISetDecoderProperties
{
void SetDecoderProperties(byte[] properties);
}
}

View File

@@ -0,0 +1,144 @@
using System;
using System.IO;
namespace SevenZip.Compression.LZMA
{
public static class SevenZipHelper
{
static int dictionary = 1 << 23;
// static Int32 posStateBits = 2;
// static Int32 litContextBits = 3; // for normal files
// UInt32 litContextBits = 0; // for 32-bit data
// static Int32 litPosBits = 0;
// UInt32 litPosBits = 2; // for 32-bit data
// static Int32 algorithm = 2;
// static Int32 numFastBytes = 128;
static bool eos = false;
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
};
public static byte[] Compress(byte[] inputBytes)
{
MemoryStream inStream = new MemoryStream(inputBytes);
MemoryStream outStream = new MemoryStream();
Encoder encoder = new Encoder();
encoder.SetCoderProperties(propIDs, properties);
encoder.WriteCoderProperties(outStream);
long fileSize = inStream.Length;
for (int i = 0; i < 8; i++)
outStream.WriteByte((Byte)(fileSize >> (8 * i)));
encoder.Code(inStream, outStream, -1, -1, null);
return outStream.ToArray();
}
public static byte[] Decompress(byte[] inputBytes)
{
MemoryStream newInStream = new MemoryStream(inputBytes);
Decoder decoder = new Decoder();
newInStream.Seek(0, 0);
MemoryStream newOutStream = new MemoryStream();
byte[] properties2 = new byte[5];
if (newInStream.Read(properties2, 0, 5) != 5)
throw (new Exception("input .lzma is too short"));
long outSize = 0;
for (int i = 0; i < 8; i++)
{
int v = newInStream.ReadByte();
if (v < 0)
throw (new Exception("Can't Read 1"));
outSize |= ((long)(byte)v) << (8 * i);
}
decoder.SetDecoderProperties(properties2);
long compressedSize = newInStream.Length - newInStream.Position;
decoder.Code(newInStream, newOutStream, compressedSize, outSize, null);
byte[] b = newOutStream.ToArray();
return b;
}
public static MemoryStream StreamDecompress(MemoryStream newInStream)
{
Decoder decoder = new Decoder();
newInStream.Seek(0, 0);
MemoryStream newOutStream = new MemoryStream();
byte[] properties2 = new byte[5];
if (newInStream.Read(properties2, 0, 5) != 5)
throw (new Exception("input .lzma is too short"));
long outSize = 0;
for (int i = 0; i < 8; i++)
{
int v = newInStream.ReadByte();
if (v < 0)
throw (new Exception("Can't Read 1"));
outSize |= ((long)(byte)v) << (8 * i);
}
decoder.SetDecoderProperties(properties2);
long compressedSize = newInStream.Length - newInStream.Position;
decoder.Code(newInStream, newOutStream, compressedSize, outSize, null);
newOutStream.Position = 0;
return newOutStream;
}
public static MemoryStream StreamDecompress(MemoryStream newInStream, long outSize)
{
Decoder decoder = new Decoder();
newInStream.Seek(0, 0);
MemoryStream newOutStream = new MemoryStream();
byte[] properties2 = new byte[5];
if (newInStream.Read(properties2, 0, 5) != 5)
throw (new Exception("input .lzma is too short"));
decoder.SetDecoderProperties(properties2);
long compressedSize = newInStream.Length - newInStream.Position;
decoder.Code(newInStream, newOutStream, compressedSize, outSize, null);
newOutStream.Position = 0;
return newOutStream;
}
}
}

View File

@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UnityStudio
{
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 reader = preloadData.Reader;
var m_Name = reader.ReadAlignedString(reader.ReadInt32());
var size = reader.ReadInt32();
for (int i = 0; i < size; i++)
{
sourceFile.ReadPPtr();
}
size = reader.ReadInt32();
for (int i = 0; i < size; i++)
{
var temp = new ContainerData();
temp.first = reader.ReadAlignedString(reader.ReadInt32());
temp.second = new AssetInfo();
temp.second.preloadIndex = reader.ReadInt32();
temp.second.preloadSize = reader.ReadInt32();
temp.second.asset = sourceFile.ReadPPtr();
m_Container.Add(temp);
}
}
}
}

View File

@@ -0,0 +1,303 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace UnityStudio
{
class AudioClip
{
public string m_Name;
public int m_Format;
public AudioType m_Type;
public bool m_3D;
public bool m_UseHardware;
//Unity 5
public int m_LoadType;
public int m_Channels;
public int m_Frequency;
public int m_BitsPerSample;
public float m_Length;
public bool m_IsTrackerFormat;
public int m_SubsoundIndex;
public bool m_PreloadAudioData;
public bool m_LoadInBackground;
public bool m_Legacy3D;
public AudioCompressionFormat m_CompressionFormat;
public string m_Source;
public long m_Offset;
public long m_Size;
public byte[] m_AudioData;
public bool version5;
public AudioClip(AssetPreloadData preloadData, bool readSwitch)
{
var sourceFile = preloadData.sourceFile;
var reader = preloadData.Reader;
if (sourceFile.platform == -2)
{
uint m_ObjectHideFlags = reader.ReadUInt32();
PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
PPtr m_PrefabInternal = sourceFile.ReadPPtr();
}
m_Name = reader.ReadAlignedString(reader.ReadInt32());
version5 = sourceFile.version[0] >= 5;
if (sourceFile.version[0] < 5)
{
m_Format = reader.ReadInt32(); //channels?
m_Type = (AudioType)reader.ReadInt32();
m_3D = reader.ReadBoolean();
m_UseHardware = reader.ReadBoolean();
reader.Position += 2; //4 byte alignment
if (sourceFile.version[0] >= 4 || (sourceFile.version[0] == 3 && sourceFile.version[1] >= 2)) //3.2.0 to 5
{
int m_Stream = reader.ReadInt32();
m_Size = reader.ReadInt32();
var tsize = m_Size % 4 != 0 ? m_Size + 4 - m_Size % 4 : m_Size;
//TODO: Need more test
if (preloadData.Size + preloadData.Offset - reader.Position != tsize)
{
m_Offset = reader.ReadInt32();
m_Source = sourceFile.filePath + ".resS";
}
}
else
{
m_Size = reader.ReadInt32();
}
}
else
{
m_LoadType = reader.ReadInt32(); //Decompress on load, Compressed in memory, Streaming
m_Channels = reader.ReadInt32();
m_Frequency = reader.ReadInt32();
m_BitsPerSample = reader.ReadInt32();
m_Length = reader.ReadSingle();
m_IsTrackerFormat = reader.ReadBoolean();
reader.Position += 3;
m_SubsoundIndex = reader.ReadInt32();
m_PreloadAudioData = reader.ReadBoolean();
m_LoadInBackground = reader.ReadBoolean();
m_Legacy3D = reader.ReadBoolean();
reader.Position += 1;
m_3D = m_Legacy3D;
m_Source = reader.ReadAlignedString(reader.ReadInt32());
m_Offset = reader.ReadInt64();
m_Size = reader.ReadInt64();
m_CompressionFormat = (AudioCompressionFormat)reader.ReadInt32();
}
if (readSwitch)
{
if (!string.IsNullOrEmpty(m_Source))
{
var resourceFileName = Path.GetFileName(m_Source);
var resourceFilePath = Path.GetDirectoryName(sourceFile.filePath) + "\\" + resourceFileName;
if (!File.Exists(resourceFilePath))
{
var findFiles = Directory.GetFiles(Path.GetDirectoryName(sourceFile.filePath), resourceFileName, SearchOption.AllDirectories);
if (findFiles.Length > 0)
{
resourceFilePath = findFiles[0];
}
}
if (File.Exists(resourceFilePath))
{
using (var resourceReader = new BinaryReader(File.OpenRead(resourceFilePath)))
{
resourceReader.BaseStream.Position = m_Offset;
m_AudioData = resourceReader.ReadBytes((int)m_Size);
}
}
else
{
if (Studio.resourceFileReaders.TryGetValue(resourceFileName.ToUpper(), out var resourceReader))
{
resourceReader.Position = m_Offset;
m_AudioData = resourceReader.ReadBytes((int)m_Size);
}
else
{
MessageBox.Show($"can't find the resource file {resourceFileName}");
}
}
}
else
{
if (m_Size > 0)
m_AudioData = reader.ReadBytes((int)m_Size);
}
}
else
{
preloadData.InfoText = "Compression format: ";
if (sourceFile.version[0] < 5)
{
switch (m_Type)
{
case AudioType.ACC:
preloadData.extension = ".m4a";
preloadData.InfoText += "Acc";
break;
case AudioType.AIFF:
preloadData.extension = ".aif";
preloadData.InfoText += "AIFF";
break;
case AudioType.IT:
preloadData.extension = ".it";
preloadData.InfoText += "Impulse tracker";
break;
case AudioType.MOD:
preloadData.extension = ".mod";
preloadData.InfoText += "Protracker / Fasttracker MOD";
break;
case AudioType.MPEG:
preloadData.extension = ".mp3";
preloadData.InfoText += "MP2/MP3 MPEG";
break;
case AudioType.OGGVORBIS:
preloadData.extension = ".ogg";
preloadData.InfoText += "Ogg vorbis";
break;
case AudioType.S3M:
preloadData.extension = ".s3m";
preloadData.InfoText += "ScreamTracker 3";
break;
case AudioType.WAV:
preloadData.extension = ".wav";
preloadData.InfoText += "Microsoft WAV";
break;
case AudioType.XM:
preloadData.extension = ".xm";
preloadData.InfoText += "FastTracker 2 XM";
break;
case AudioType.XMA:
preloadData.extension = ".wav";
preloadData.InfoText += "Xbox360 XMA";
break;
case AudioType.VAG:
preloadData.extension = ".vag";
preloadData.InfoText += "PlayStation Portable ADPCM";
break;
case AudioType.AUDIOQUEUE:
preloadData.extension = ".fsb";
preloadData.InfoText += "iPhone";
break;
}
}
else
{
switch (m_CompressionFormat)
{
case AudioCompressionFormat.PCM:
preloadData.extension = ".fsb";
preloadData.InfoText += "PCM";
break;
case AudioCompressionFormat.Vorbis:
preloadData.extension = ".fsb";
preloadData.InfoText += "Vorbis";
break;
case AudioCompressionFormat.ADPCM:
preloadData.extension = ".fsb";
preloadData.InfoText += "ADPCM";
break;
case AudioCompressionFormat.MP3:
preloadData.extension = ".fsb";
preloadData.InfoText += "MP3";
break;
case AudioCompressionFormat.VAG:
preloadData.extension = ".vag";
preloadData.InfoText += "PlayStation Portable ADPCM";
break;
case AudioCompressionFormat.HEVAG:
preloadData.extension = ".vag";
preloadData.InfoText += "PSVita ADPCM";
break;
case AudioCompressionFormat.XMA:
preloadData.extension = ".wav";
preloadData.InfoText += "Xbox360 XMA";
break;
case AudioCompressionFormat.AAC:
preloadData.extension = ".m4a";
preloadData.InfoText += "AAC";
break;
case AudioCompressionFormat.GCADPCM:
preloadData.extension = ".fsb";
preloadData.InfoText += "Nintendo 3DS/Wii DSP";
break;
case AudioCompressionFormat.ATRAC9:
preloadData.extension = ".at9";
preloadData.InfoText += "PSVita ATRAC9";
break;
}
}
if (preloadData.extension == null)
{
preloadData.extension = ".AudioClip";
preloadData.InfoText += "Unknown";
}
preloadData.InfoText += "\n3D: " + m_3D;
preloadData.Text = m_Name;
if (m_Source != null)
preloadData.fullSize = preloadData.Size + (int)m_Size;
}
}
public bool IsFMODSupport
{
get
{
if (!version5)
{
switch (m_Type)
{
case AudioType.AIFF:
case AudioType.IT:
case AudioType.MOD:
case AudioType.S3M:
case AudioType.XM:
case AudioType.XMA:
case AudioType.VAG:
case AudioType.AUDIOQUEUE:
return true;
default:
return false;
}
}
else
{
switch (m_CompressionFormat)
{
case AudioCompressionFormat.PCM:
case AudioCompressionFormat.Vorbis:
case AudioCompressionFormat.ADPCM:
case AudioCompressionFormat.MP3:
case AudioCompressionFormat.VAG:
case AudioCompressionFormat.HEVAG:
case AudioCompressionFormat.XMA:
case AudioCompressionFormat.GCADPCM:
case AudioCompressionFormat.ATRAC9:
return true;
default:
return false;
}
}
}
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UnityStudio
{
public class BuildSettings
{
public string m_Version;
public BuildSettings(AssetPreloadData preloadData)
{
var sourceFile = preloadData.sourceFile;
var reader = preloadData.Reader;
int levels = reader.ReadInt32();
for (int l = 0; l < levels; l++) { string level = reader.ReadAlignedString(reader.ReadInt32()); }
if (sourceFile.version[0] == 5)
{
int preloadedPlugins = reader.ReadInt32();
for (int l = 0; l < preloadedPlugins; l++) { string preloadedPlugin = reader.ReadAlignedString(reader.ReadInt32()); }
}
reader.Position += 4; //bool flags
if (sourceFile.fileGen >= 8) { reader.Position += 4; } //bool flags
if (sourceFile.fileGen >= 9) { reader.Position += 4; } //bool flags
if (sourceFile.version[0] == 5 ||
(sourceFile.version[0] == 4 && (sourceFile.version[1] >= 3 ||
(sourceFile.version[1] == 2 && sourceFile.buildType[0] != "a"))))
{ reader.Position += 4; } //bool flags
m_Version = reader.ReadAlignedString(reader.ReadInt32());
}
}
}

190
UnityStudio/Classes/Font.cs Normal file
View File

@@ -0,0 +1,190 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UnityStudio
{
class UnityFont
{
public string m_Name;
public byte[] m_FontData;
public UnityFont(AssetPreloadData preloadData, bool readSwitch)
{
var sourceFile = preloadData.sourceFile;
var reader = preloadData.Reader;
if (sourceFile.platform == -2)
{
uint m_ObjectHideFlags = reader.ReadUInt32();
PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
PPtr m_PrefabInternal = sourceFile.ReadPPtr();
}
m_Name = reader.ReadAlignedString(reader.ReadInt32());
if (readSwitch)
{
if ((sourceFile.version[0] == 5 && sourceFile.version[1] >= 5) || sourceFile.version[0] > 5)
{
var m_LineSpacing = reader.ReadSingle();
var m_DefaultMaterial = sourceFile.ReadPPtr();
var m_FontSize = reader.ReadSingle();
var m_Texture = sourceFile.ReadPPtr();
int m_AsciiStartOffset = reader.ReadInt32();
var m_Tracking = reader.ReadSingle();
var m_CharacterSpacing = reader.ReadInt32();
var m_CharacterPadding = reader.ReadInt32();
var m_ConvertCase = reader.ReadInt32();
int m_CharacterRects_size = reader.ReadInt32();
for (int i = 0; i < m_CharacterRects_size; i++)
{
int index = reader.ReadInt32();
//Rectf uv
float uvx = reader.ReadSingle();
float uvy = reader.ReadSingle();
float uvwidth = reader.ReadSingle();
float uvheight = reader.ReadSingle();
//Rectf vert
float vertx = reader.ReadSingle();
float verty = reader.ReadSingle();
float vertwidth = reader.ReadSingle();
float vertheight = reader.ReadSingle();
float width = reader.ReadSingle();
if (sourceFile.version[0] >= 4)
{
bool flipped = reader.ReadBoolean();
reader.Position += 3;
}
}
int m_KerningValues_size = reader.ReadInt32();
for (int i = 0; i < m_KerningValues_size; i++)
{
int pairfirst = reader.ReadInt16();
int pairsecond = reader.ReadInt16();
float second = reader.ReadSingle();
}
var m_PixelScale = reader.ReadSingle();
int m_FontData_size = reader.ReadInt32();
if (m_FontData_size > 0)
{
m_FontData = reader.ReadBytes(m_FontData_size);
if (m_FontData[0] == 79 && m_FontData[1] == 84 && m_FontData[2] == 84 && m_FontData[3] == 79)
{ preloadData.extension = ".otf"; }
else { preloadData.extension = ".ttf"; }
}
}
else
{
int m_AsciiStartOffset = reader.ReadInt32();
if (sourceFile.version[0] <= 3)
{
int m_FontCountX = reader.ReadInt32();
int m_FontCountY = reader.ReadInt32();
}
float m_Kerning = reader.ReadSingle();
float m_LineSpacing = reader.ReadSingle();
if (sourceFile.version[0] <= 3)
{
int m_PerCharacterKerning_size = reader.ReadInt32();
for (int i = 0; i < m_PerCharacterKerning_size; i++)
{
int first = reader.ReadInt32();
float second = reader.ReadSingle();
}
}
else
{
int m_CharacterSpacing = reader.ReadInt32();
int m_CharacterPadding = reader.ReadInt32();
}
int m_ConvertCase = reader.ReadInt32();
PPtr m_DefaultMaterial = sourceFile.ReadPPtr();
int m_CharacterRects_size = reader.ReadInt32();
for (int i = 0; i < m_CharacterRects_size; i++)
{
int index = reader.ReadInt32();
//Rectf uv
float uvx = reader.ReadSingle();
float uvy = reader.ReadSingle();
float uvwidth = reader.ReadSingle();
float uvheight = reader.ReadSingle();
//Rectf vert
float vertx = reader.ReadSingle();
float verty = reader.ReadSingle();
float vertwidth = reader.ReadSingle();
float vertheight = reader.ReadSingle();
float width = reader.ReadSingle();
if (sourceFile.version[0] >= 4)
{
bool flipped = reader.ReadBoolean();
reader.Position += 3;
}
}
PPtr m_Texture = sourceFile.ReadPPtr();
int m_KerningValues_size = reader.ReadInt32();
for (int i = 0; i < m_KerningValues_size; i++)
{
int pairfirst = reader.ReadInt16();
int pairsecond = reader.ReadInt16();
float second = reader.ReadSingle();
}
if (sourceFile.version[0] <= 3)
{
bool m_GridFont = reader.ReadBoolean();
reader.Position += 3; //4 byte alignment
}
else { float m_PixelScale = reader.ReadSingle(); }
int m_FontData_size = reader.ReadInt32();
if (m_FontData_size > 0)
{
m_FontData = reader.ReadBytes(m_FontData_size);
if (m_FontData[0] == 79 && m_FontData[1] == 84 && m_FontData[2] == 84 && m_FontData[3] == 79)
{ preloadData.extension = ".otf"; }
else { preloadData.extension = ".ttf"; }
}
float m_FontSize = reader.ReadSingle();//problem here in minifootball
float m_Ascent = reader.ReadSingle();
uint m_DefaultStyle = reader.ReadUInt32();
int m_FontNames = reader.ReadInt32();
for (int i = 0; i < m_FontNames; i++)
{
string m_FontName = reader.ReadAlignedString(reader.ReadInt32());
}
if (sourceFile.version[0] >= 4)
{
int m_FallbackFonts = reader.ReadInt32();
for (int i = 0; i < m_FallbackFonts; i++)
{
PPtr m_FallbackFont = sourceFile.ReadPPtr();
}
int m_FontRenderingMode = reader.ReadInt32();
}
}
}
else
{
preloadData.Text = m_Name;
}
}
}
}

View File

@@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace UnityStudio
{
public class GameObject : TreeNode
{
public List<PPtr> m_Components = new List<PPtr>();
public PPtr m_Transform;
public PPtr m_MeshRenderer;
public PPtr m_MeshFilter;
public PPtr m_SkinnedMeshRenderer;
public int m_Layer;
public string m_Name;
public ushort m_Tag;
public bool m_IsActive;
public string uniqueID = "0";//this way file and folder TreeNodes will be treated as FBX scene
public GameObject(AssetPreloadData preloadData)
{
if (preloadData != null)
{
var sourceFile = preloadData.sourceFile;
var reader = preloadData.Reader;
uniqueID = preloadData.uniqueID;
if (sourceFile.platform == -2)
{
uint m_ObjectHideFlags = reader.ReadUInt32();
PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
PPtr m_PrefabInternal = sourceFile.ReadPPtr();
}
int m_Component_size = reader.ReadInt32();
for (int j = 0; j < m_Component_size; j++)
{
if ((sourceFile.version[0] == 5 && sourceFile.version[1] >= 5) || sourceFile.version[0] > 5)//5.5.0 and up
{
m_Components.Add(sourceFile.ReadPPtr());
}
else
{
int first = reader.ReadInt32();
m_Components.Add(sourceFile.ReadPPtr());
}
}
m_Layer = reader.ReadInt32();
m_Name = reader.ReadAlignedString(reader.ReadInt32());
if (m_Name == "") { m_Name = "GameObject #" + uniqueID; }
m_Tag = reader.ReadUInt16();
m_IsActive = reader.ReadBoolean();
Text = m_Name;
preloadData.Text = m_Name;
//name should be unique
Name = uniqueID;
}
}
}
}

View File

@@ -0,0 +1,129 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UnityStudio
{
class TexEnv
{
public string name;
public PPtr m_Texture;
public float[] m_Scale;
public float[] m_Offset;
}
class strFloatPair
{
public string first;
public float second;
}
class strColorPair
{
public string first;
public float[] second;
}
class Material
{
public string m_Name;
public PPtr m_Shader;
public string[] m_ShaderKeywords;
public int m_CustomRenderQueue;
public TexEnv[] m_TexEnvs;
public strFloatPair[] m_Floats;
public strColorPair[] m_Colors;
public Material(AssetPreloadData preloadData)
{
var sourceFile = preloadData.sourceFile;
var reader = preloadData.Reader;
if (sourceFile.platform == -2)
{
uint m_ObjectHideFlags = reader.ReadUInt32();
PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
PPtr m_PrefabInternal = sourceFile.ReadPPtr();
}
m_Name = reader.ReadAlignedString(reader.ReadInt32());
m_Shader = sourceFile.ReadPPtr();
if (sourceFile.version[0] == 4 && (sourceFile.version[1] >= 2 || (sourceFile.version[1] == 1 && sourceFile.buildType[0] != "a")))
{
m_ShaderKeywords = new string[reader.ReadInt32()];
for (int i = 0; i < m_ShaderKeywords.Length; i++)
{
m_ShaderKeywords[i] = reader.ReadAlignedString(reader.ReadInt32());
}
}
else if (sourceFile.version[0] >= 5)//5.0 and up
{
m_ShaderKeywords = new[] { reader.ReadAlignedString(reader.ReadInt32()) };
uint m_LightmapFlags = reader.ReadUInt32();
if (sourceFile.version[0] == 5 && sourceFile.version[1] >= 6 || sourceFile.version[0] > 5)//5.6.0 and up
{
var m_EnableInstancingVariants = reader.ReadBoolean();
//var m_DoubleSidedGI = a_Stream.ReadBoolean();//2017.x
reader.AlignStream(4);
}
}
if (sourceFile.version[0] > 4 || sourceFile.version[0] == 4 && sourceFile.version[1] >= 3) { m_CustomRenderQueue = reader.ReadInt32(); }
if (sourceFile.version[0] == 5 && sourceFile.version[1] >= 1 || sourceFile.version[0] > 5)//5.1 and up
{
string[][] stringTagMap = new string[reader.ReadInt32()][];
for (int i = 0; i < stringTagMap.Length; i++)
{
stringTagMap[i] = new[] { reader.ReadAlignedString(reader.ReadInt32()), reader.ReadAlignedString(reader.ReadInt32()) };
}
}
//disabledShaderPasses
if ((sourceFile.version[0] == 5 && sourceFile.version[1] >= 6) || sourceFile.version[0] > 5)//5.6.0 and up
{
var size = reader.ReadInt32();
for (int i = 0; i < size; i++)
{
reader.ReadAlignedString(reader.ReadInt32());
}
}
//m_SavedProperties
m_TexEnvs = new TexEnv[reader.ReadInt32()];
for (int i = 0; i < m_TexEnvs.Length; i++)
{
TexEnv m_TexEnv = new TexEnv()
{
name = reader.ReadAlignedString(reader.ReadInt32()),
m_Texture = sourceFile.ReadPPtr(),
m_Scale = new[] { reader.ReadSingle(), reader.ReadSingle() },
m_Offset = new[] { reader.ReadSingle(), reader.ReadSingle() }
};
m_TexEnvs[i] = m_TexEnv;
}
m_Floats = new strFloatPair[reader.ReadInt32()];
for (int i = 0; i < m_Floats.Length; i++)
{
strFloatPair m_Float = new strFloatPair()
{
first = reader.ReadAlignedString(reader.ReadInt32()),
second = reader.ReadSingle()
};
m_Floats[i] = m_Float;
}
m_Colors = new strColorPair[reader.ReadInt32()];
for (int i = 0; i < m_Colors.Length; i++)
{
strColorPair m_Color = new strColorPair()
{
first = reader.ReadAlignedString(reader.ReadInt32()),
second = new[] { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() }
};
m_Colors[i] = m_Color;
}
}
}
}

1295
UnityStudio/Classes/Mesh.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UnityStudio
{
public class MeshFilter
{
public long preloadIndex;
public PPtr m_GameObject = new PPtr();
public PPtr m_Mesh = new PPtr();
public MeshFilter(AssetPreloadData preloadData)
{
var sourceFile = preloadData.sourceFile;
var reader = preloadData.Reader;
if (sourceFile.platform == -2)
{
uint m_ObjectHideFlags = reader.ReadUInt32();
PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
PPtr m_PrefabInternal = sourceFile.ReadPPtr();
}
m_GameObject = sourceFile.ReadPPtr();
m_Mesh = sourceFile.ReadPPtr();
}
}
}

View File

@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UnityStudio
{
class MeshRenderer
{
public PPtr m_GameObject;
public bool m_Enabled;
public byte m_CastShadows; //bool prior to Unity 5
public bool m_ReceiveShadows;
public ushort m_LightmapIndex;
public ushort m_LightmapIndexDynamic;
public PPtr[] m_Materials;
public MeshRenderer(AssetPreloadData preloadData)
{
var sourceFile = preloadData.sourceFile;
var reader = preloadData.Reader;
if (sourceFile.platform == -2)
{
uint m_ObjectHideFlags = reader.ReadUInt32();
PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
PPtr m_PrefabInternal = sourceFile.ReadPPtr();
}
m_GameObject = sourceFile.ReadPPtr();
if (sourceFile.version[0] < 5)
{
m_Enabled = reader.ReadBoolean();
m_CastShadows = reader.ReadByte();
m_ReceiveShadows = reader.ReadBoolean();
m_LightmapIndex = reader.ReadByte();
}
else
{
m_Enabled = reader.ReadBoolean();
reader.AlignStream(4);
m_CastShadows = reader.ReadByte();
m_ReceiveShadows = reader.ReadBoolean();
reader.AlignStream(4);
m_LightmapIndex = reader.ReadUInt16();
m_LightmapIndexDynamic = reader.ReadUInt16();
}
if (sourceFile.version[0] >= 3) { reader.Position += 16; } //Vector4f m_LightmapTilingOffset
if (sourceFile.version[0] >= 5) { reader.Position += 16; } //Vector4f m_LightmapTilingOffsetDynamic
m_Materials = new PPtr[reader.ReadInt32()];
for (int m = 0; m < m_Materials.Length; m++)
{
m_Materials[m] = sourceFile.ReadPPtr();
}
}
}
}

View File

@@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UnityStudio
{
class MonoBehaviour
{
public string serializedText;
public MonoBehaviour(AssetPreloadData preloadData, bool readSwitch)
{
var sourceFile = preloadData.sourceFile;
var reader = preloadData.Reader;
var m_GameObject = sourceFile.ReadPPtr();
var m_Enabled = reader.ReadByte();
reader.AlignStream(4);
var m_Script = sourceFile.ReadPPtr();
var m_Name = reader.ReadAlignedString(reader.ReadInt32());
if (readSwitch)
{
if ((serializedText = preloadData.ViewStruct()) == null)
{
var str = "PPtr<GameObject> m_GameObject\r\n";
str += "\tint m_FileID = " + m_GameObject.m_FileID + "\r\n";
str += "\tint64 m_PathID = " + m_GameObject.m_PathID + "\r\n";
str += "UInt8 m_Enabled = " + m_Enabled + "\r\n";
str += "PPtr<MonoScript> m_Script\r\n";
str += "\tint m_FileID = " + m_Script.m_FileID + "\r\n";
str += "\tint64 m_PathID = " + m_Script.m_PathID + "\r\n";
str += "string m_Name = \"" + m_Name + "\"\r\n";
serializedText = str;
}
}
else
{
preloadData.extension = ".txt";
preloadData.Text = m_Name;
}
}
}
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UnityStudio
{
class MovieTexture
{
public string m_Name;
public byte[] m_MovieData;
public MovieTexture(AssetPreloadData preloadData, bool readSwitch)
{
var sourceFile = preloadData.sourceFile;
var reader = preloadData.Reader;
m_Name = reader.ReadAlignedString(reader.ReadInt32());
if (readSwitch)
{
var m_Loop = reader.ReadBoolean();
reader.AlignStream(4);
//PPtr<AudioClip>
sourceFile.ReadPPtr();
var size = reader.ReadInt32();
m_MovieData = reader.ReadBytes(size);
var m_ColorSpace = reader.ReadInt32();
}
else
{
preloadData.extension = ".ogv";
preloadData.Text = m_Name;
}
}
}
}

View File

@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UnityStudio
{
public class PlayerSettings
{
public string companyName;
public string productName;
public PlayerSettings(AssetPreloadData preloadData)
{
var sourceFile = preloadData.sourceFile;
var reader = preloadData.Reader;
if ((sourceFile.version[0] == 5 && sourceFile.version[1] >= 4) || sourceFile.version[0] > 5)//5.4.0 nad up
{
//productGUID
reader.ReadInt32();
reader.ReadInt32();
reader.ReadInt32();
reader.ReadInt32();
}
if (sourceFile.version[0] >= 3)
{
if (sourceFile.version[0] == 3 && sourceFile.version[1] < 2) { string AndroidLicensePublicKey = reader.ReadAlignedString(reader.ReadInt32()); }
else { bool AndroidProfiler = reader.ReadBoolean(); reader.AlignStream(4); }
int defaultScreenOrientation = reader.ReadInt32();
int targetDevice = reader.ReadInt32();
if (sourceFile.version[0] < 5 || (sourceFile.version[0] == 5 && sourceFile.version[1] < 1))
{ int targetGlesGraphics = reader.ReadInt32(); }
if ((sourceFile.version[0] == 5 && sourceFile.version[1] < 1) || (sourceFile.version[0] == 4 && sourceFile.version[1] == 6 && sourceFile.version[2] >= 3))
{ int targetIOSGraphics = reader.ReadInt32(); }
if (sourceFile.version[0] >= 5 || sourceFile.version[0] == 5 && (sourceFile.version[1] > 2 || (sourceFile.version[1] == 2 && sourceFile.version[2] >= 1)))
{ bool useOnDemandResources = reader.ReadBoolean(); reader.AlignStream(4); }
if (sourceFile.version[0] < 5 || (sourceFile.version[0] == 5 && sourceFile.version[1] < 3))
{ int targetResolution = reader.ReadInt32(); }
if (sourceFile.version[0] == 3 && sourceFile.version[1] <= 1) { bool OverrideIPodMusic = reader.ReadBoolean(); reader.AlignStream(4); }
else if (sourceFile.version[0] == 3 && sourceFile.version[1] <= 4) { }
else { int accelerometerFrequency = reader.ReadInt32(); }//3.5.0 and up
}
//fail in Unity 5 beta
companyName = reader.ReadAlignedString(reader.ReadInt32());
productName = reader.ReadAlignedString(reader.ReadInt32());
}
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UnityStudio
{
public class RectTransform
{
public Transform m_Transform;
public RectTransform(AssetPreloadData preloadData)
{
m_Transform = new Transform(preloadData);
//var sourceFile = preloadData.sourceFile;
//var a_Stream = preloadData.sourceFile.a_Stream;
/*
float[2] AnchorsMin
float[2] AnchorsMax
float[2] Pivod
float Width
float Height
float[2] ?
*/
}
}
}

View File

@@ -0,0 +1,201 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Web.Script.Serialization;
using Lz4;
namespace UnityStudio
{
class Shader
{
public string m_Name;
public byte[] m_Script;
public Shader(AssetPreloadData preloadData, bool readSwitch)
{
var sourceFile = preloadData.sourceFile;
var reader = preloadData.Reader;
if (sourceFile.platform == -2)
{
uint m_ObjectHideFlags = reader.ReadUInt32();
PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
PPtr m_PrefabInternal = sourceFile.ReadPPtr();
}
m_Name = reader.ReadAlignedString(reader.ReadInt32());
if (readSwitch)
{
if (sourceFile.version[0] == 5 && sourceFile.version[1] >= 5 || sourceFile.version[0] > 5)//5.5.0 and up
{
var str = (string)ShaderResource.ResourceManager.GetObject($"Shader{sourceFile.version[0]}{sourceFile.version[1]}");
if (str == null)
{
str = preloadData.ViewStruct();
if (str == null)
m_Script = Encoding.UTF8.GetBytes("Serialized Shader can't be read");
else
m_Script = Encoding.UTF8.GetBytes(str);
}
else
{
reader.Position = preloadData.Offset;
var sb = new StringBuilder();
var members = new JavaScriptSerializer().Deserialize<List<ClassMember>>(str);
ClassStructHelper.ReadClassStruct(sb, members, reader);
m_Script = Encoding.UTF8.GetBytes(sb.ToString());
//m_Script = ReadSerializedShader(members, a_Stream);
}
}
else
{
m_Script = reader.ReadBytes(reader.ReadInt32());
if (sourceFile.version[0] == 5 && sourceFile.version[1] >= 3) //5.3 - 5.4
{
reader.AlignStream(4);
reader.ReadAlignedString(reader.ReadInt32());//m_PathName
var decompressedSize = reader.ReadUInt32();
var m_SubProgramBlob = reader.ReadBytes(reader.ReadInt32());
var decompressedBytes = new byte[decompressedSize];
using (var decoder = new Lz4DecoderStream(new MemoryStream(m_SubProgramBlob)))
{
decoder.Read(decompressedBytes, 0, (int)decompressedSize);
}
m_Script = m_Script.Concat(decompressedBytes.ToArray()).ToArray();
}
}
}
else
{
preloadData.extension = ".txt";
preloadData.Text = m_Name;
}
}
/*private static byte[] ReadSerializedShader(List<ClassMember> members, EndianBinaryReader 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")
{
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 (member.alignBefore)
a_Stream.AlignStream(4);
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" || varTypeStr == "Type*")//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 = ClassStructHelper.ReadArray(members, level, i);
for (int j = 0; j < size; j++)
{
ReadSerializedShader(array, a_Stream);
}
i += array.Count + 1;//skip
}
else
{
if (align)
{
align = false;
ClassStructHelper.SetAlignBefore(members, level, i + 1);
}
}
if (align)
a_Stream.AlignStream(4);
}
return null;
}*/
}
}

View File

@@ -0,0 +1,150 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UnityStudio
{
public class SkinnedMeshRenderer
{
public PPtr m_GameObject;
public bool m_Enabled;
public byte m_CastShadows;
public bool m_ReceiveShadows;
public ushort m_LightmapIndex;
public ushort m_LightmapIndexDynamic;
public PPtr[] m_Materials;
public PPtr m_Mesh;
public PPtr[] m_Bones;
public SkinnedMeshRenderer(AssetPreloadData preloadData)
{
var sourceFile = preloadData.sourceFile;
var version = preloadData.sourceFile.version;
var reader = preloadData.Reader;
if (sourceFile.platform == -2)
{
uint m_ObjectHideFlags = reader.ReadUInt32();
PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
PPtr m_PrefabInternal = sourceFile.ReadPPtr();
}
m_GameObject = sourceFile.ReadPPtr();
if (sourceFile.version[0] < 5)
{
m_Enabled = reader.ReadBoolean();
m_CastShadows = reader.ReadByte();//bool
m_ReceiveShadows = reader.ReadBoolean();
m_LightmapIndex = reader.ReadByte();
}
else
{
m_Enabled = reader.ReadBoolean();
reader.AlignStream(4);
m_CastShadows = reader.ReadByte();
m_ReceiveShadows = reader.ReadBoolean();
reader.AlignStream(4);
m_LightmapIndex = reader.ReadUInt16();
m_LightmapIndexDynamic = reader.ReadUInt16();
}
if (version[0] >= 3) { reader.Position += 16; } //m_LightmapTilingOffset vector4d
if (sourceFile.version[0] >= 5) { reader.Position += 16; } //Vector4f m_LightmapTilingOffsetDynamic
m_Materials = new PPtr[reader.ReadInt32()];
for (int m = 0; m < m_Materials.Length; m++)
{
m_Materials[m] = sourceFile.ReadPPtr();
}
if (version[0] < 3)
{
reader.Position += 16;//m_LightmapTilingOffset vector4d
}
else
{
if ((sourceFile.version[0] == 5 && sourceFile.version[1] >= 5) || sourceFile.version[0] > 5)//5.5.0 and up
{
reader.Position += 4;//m_StaticBatchInfo
}
else
{
int m_SubsetIndices_size = reader.ReadInt32();
reader.Position += m_SubsetIndices_size * 4;
}
PPtr m_StaticBatchRoot = sourceFile.ReadPPtr();
if ((sourceFile.version[0] == 5 && sourceFile.version[1] >= 4) || sourceFile.version[0] > 5)//5.4.0 and up
{
PPtr m_ProbeAnchor = sourceFile.ReadPPtr();
PPtr m_LightProbeVolumeOverride = sourceFile.ReadPPtr();
}
else if (version[0] >= 4 || (version[0] == 3 && version[1] >= 5))
{
bool m_UseLightProbes = reader.ReadBoolean();
reader.Position += 3; //alignment
if (version[0] == 5) { int m_ReflectionProbeUsage = reader.ReadInt32(); }
//did I ever check if the anchor is conditioned by the bool?
PPtr m_LightProbeAnchor = sourceFile.ReadPPtr();
}
if (version[0] >= 5 || (version[0] == 4 && version[1] >= 3))
{
if (version[0] == 4 && version[1] <= 3) { int m_SortingLayer = reader.ReadInt16(); }
else { int m_SortingLayer = reader.ReadInt32(); }
int m_SortingOrder = reader.ReadInt16();
reader.AlignStream(4);
}
}
int m_Quality = reader.ReadInt32();
bool m_UpdateWhenOffscreen = reader.ReadBoolean();
bool m_SkinNormals = reader.ReadBoolean(); //3.1.0 and below
reader.Position += 2;
if (version[0] == 2 && version[1] < 6)
{
//this would be the only error if mainVersion is not read in time for a unity 2.x game
PPtr m_DisableAnimationWhenOffscreen = sourceFile.ReadPPtr();
}
m_Mesh = sourceFile.ReadPPtr();
m_Bones = new PPtr[reader.ReadInt32()];
for (int b = 0; b < m_Bones.Length; b++)
{
m_Bones[b] = sourceFile.ReadPPtr();
}
if (version[0] < 3)
{
int m_BindPose = reader.ReadInt32();
reader.Position += m_BindPose * 16 * 4;//Matrix4x4f
}
else
{
if (version[0] > 4 || (version[0] == 4 && version[1] >= 3))
{
int m_BlendShapeWeights = reader.ReadInt32();
reader.Position += m_BlendShapeWeights * 4; //floats
}
if (version[0] > 4 || (version[0] >= 3 && version[1] >= 5))
{
PPtr m_RootBone = sourceFile.ReadPPtr();
}
if (version[0] > 4 || (version[0] == 3 && version[1] >= 4))
{
//AABB
float[] m_Center = { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() };
float[] m_Extent = { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() };
bool m_DirtyAABB = reader.ReadBoolean();
}
}
}
}
}

View File

@@ -0,0 +1,169 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
namespace UnityStudio
{
class Sprite
{
public string m_Name;
public RectangleF m_Rect;
public float m_PixelsToUnits;
public PointF m_Pivot;
public Guid first;
public PPtr texture;
public PPtr m_SpriteAtlas;
public RectangleF textureRect;
public PointF[][] m_PhysicsShape;
public Sprite(AssetPreloadData preloadData, bool readSwitch)
{
var sourceFile = preloadData.sourceFile;
var reader = preloadData.Reader;
var version = sourceFile.version;
m_Name = reader.ReadAlignedString(reader.ReadInt32());
if (readSwitch)
{
//Rectf m_Rect
m_Rect = new RectangleF(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
//Vector2f m_Offset
reader.Position += 8;
if (version[0] > 4 || (version[0] == 4 && version[1] >= 5)) //4.5 and up
{
//Vector4f m_Border
reader.Position += 16;
}
m_PixelsToUnits = reader.ReadSingle();
if (version[0] > 5
|| (version[0] == 5 && version[1] > 4)
|| (version[0] == 5 && version[1] == 4 && version[2] >= 2)) //5.4.2 and up
{
//Vector2f m_Pivot
m_Pivot = new PointF(reader.ReadSingle(), reader.ReadSingle());
}
var m_Extrude = reader.ReadUInt32();
if (version[0] > 5 || (version[0] == 5 && version[1] >= 3)) //5.3 and up TODO need more test
{
var m_IsPolygon = reader.ReadBoolean();
reader.AlignStream(4);
}
if (version[0] >= 2017) //2017 and up
{
//pair m_RenderDataKey
first = new Guid(reader.ReadBytes(16));
var second = reader.ReadInt64();
//vector m_AtlasTags
var size = reader.ReadInt32();
for (int i = 0; i < size; i++)
{
var data = reader.ReadAlignedString(reader.ReadInt32());
}
//PPtr<SpriteAtlas> m_SpriteAtlas
m_SpriteAtlas = sourceFile.ReadPPtr();
}
//SpriteRenderData m_RD
// PPtr<Texture2D> texture
texture = sourceFile.ReadPPtr();
// PPtr<Texture2D> alphaTexture
if (version[0] >= 5) //5.0 and up
{
var alphaTexture = sourceFile.ReadPPtr();
}
if (version[0] > 5 || (version[0] == 5 && version[1] >= 6)) //5.6 and up
{
// vector m_SubMeshes
var size = reader.ReadInt32();
// SubMesh data
if (version[0] > 2017 || (version[0] == 2017 && version[1] >= 3)) //2017.3 and up
{
reader.Position += 48 * size;
}
else
{
reader.Position += 44 * size;
}
// vector m_IndexBuffer
size = reader.ReadInt32();
reader.Position += size; //UInt8 data
reader.AlignStream(4);
// VertexData m_VertexData
var m_CurrentChannels = reader.ReadInt32();
var m_VertexCount = reader.ReadUInt32();
// vector m_Channels
size = reader.ReadInt32();
reader.Position += size * 4; //ChannelInfo data
// TypelessData m_DataSize
size = reader.ReadInt32();
reader.Position += size; //UInt8 data
reader.AlignStream(4);
}
else
{
// vector vertices
var size = reader.ReadInt32();
for (int i = 0; i < size; i++)
{
//SpriteVertex data
reader.Position += 12; //Vector3f pos
if (version[0] < 4 || (version[0] == 4 && version[1] <= 3)) //4.3 and down
reader.Position += 8; //Vector2f uv
}
// vector indices
size = reader.ReadInt32();
reader.Position += 2 * size; //UInt16 data
reader.AlignStream(4);
}
// Rectf textureRect
textureRect = new RectangleF(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
// Vector2f textureRectOffset
reader.Position += 8;
// Vector2f atlasRectOffset - 5.6 and up
if (version[0] > 5 || (version[0] == 5 && version[1] >= 6)) //5.6 and up
{
reader.Position += 8;
}
// unsigned int settingsRaw
reader.Position += 4;
// Vector4f uvTransform - 4.5 and up
if (version[0] > 4 || (version[0] == 4 && version[1] >= 5)) //4.5 and up
{
reader.Position += 16;
}
if (version[0] >= 2017) //2017 and up
{
// float downscaleMultiplier - 2017 and up
reader.Position += 4;
//vector m_PhysicsShape - 2017 and up
var m_PhysicsShape_size = reader.ReadInt32();
m_PhysicsShape = new PointF[m_PhysicsShape_size][];
for (int i = 0; i < m_PhysicsShape_size; i++)
{
var data_size = reader.ReadInt32();
//Vector2f
m_PhysicsShape[i] = new PointF[data_size];
for (int j = 0; j < data_size; j++)
{
m_PhysicsShape[i][j] = new PointF(reader.ReadSingle(), reader.ReadSingle());
}
}
}
}
else
{
preloadData.Text = m_Name;
}
}
}
}

View File

@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
namespace UnityStudio
{
class SpriteAtlas
{
public List<PPtr> textures = new List<PPtr>();
public List<RectangleF> textureRects = new List<RectangleF>();
public List<Guid> guids = new List<Guid>();
public SpriteAtlas(AssetPreloadData preloadData)
{
var sourceFile = preloadData.sourceFile;
var reader = preloadData.Reader;
var m_Name = reader.ReadAlignedString(reader.ReadInt32());
//vector m_PackedSprites
var size = reader.ReadInt32();
for (int i = 0; i < size; i++)
{
//PPtr<Sprite> data
sourceFile.ReadPPtr();
}
//vector m_PackedSpriteNamesToIndex
size = reader.ReadInt32();
for (int i = 0; i < size; i++)
{
var data = reader.ReadAlignedString(reader.ReadInt32());
}
//map m_RenderDataMap
size = reader.ReadInt32();
for (int i = 0; i < size; i++)
{
//pair first
guids.Add(new Guid(reader.ReadBytes(16)));
var second = reader.ReadInt64();
//SpriteAtlasData second
// PPtr<Texture2D> texture
textures.Add(sourceFile.ReadPPtr());
// PPtr<Texture2D> alphaTexture
var alphaTexture = sourceFile.ReadPPtr();
// Rectf textureRect
textureRects.Add(new RectangleF(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()));
// Vector2f textureRectOffset
reader.Position += 8;
if (sourceFile.version[0] > 2017 || (sourceFile.version[0] == 2017 && sourceFile.version[1] >= 2))//2017.2 and up
{
// Vector2f atlasRectOffset
reader.Position += 8;
}
// Vector4f uvTransform
// float downscaleMultiplier
// unsigned int settingsRaw
reader.Position += 24;
}
//string m_Tag
//bool m_IsVariant
}
}
}

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
namespace UnityStudio
{
class TextAsset
{
public string m_Name;
public byte[] m_Script;
public TextAsset(AssetPreloadData preloadData, bool readSwitch)
{
var sourceFile = preloadData.sourceFile;
var reader = preloadData.Reader;
if (sourceFile.platform == -2)
{
uint m_ObjectHideFlags = reader.ReadUInt32();
PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
PPtr m_PrefabInternal = sourceFile.ReadPPtr();
}
m_Name = reader.ReadAlignedString(reader.ReadInt32());
if (readSwitch)
{
m_Script = reader.ReadBytes(reader.ReadInt32());
}
else
{
preloadData.extension = ".txt";
preloadData.Text = m_Name;
}
}
}
}

View File

@@ -0,0 +1,778 @@
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace UnityStudio
{
partial class Texture2D
{
public string m_Name;
public int m_Width;
public int m_Height;
public int m_CompleteImageSize;
public TextureFormat m_TextureFormat;
public bool m_MipMap;
public bool m_IsReadable;
public bool m_ReadAllowed;
public int m_ImageCount;
public int m_TextureDimension;
//m_TextureSettings
public int m_FilterMode;
public int m_Aniso;
public float m_MipBias;
public int m_WrapMode;
public int m_LightmapFormat;
public int m_ColorSpace;
//image dataa
public int image_data_size;
public byte[] image_data;
//m_StreamData
public uint offset;
public uint size;
public string path;
//DDS Start
private byte[] dwMagic = { 0x44, 0x44, 0x53, 0x20, 0x7c };
private int dwFlags = 0x1 + 0x2 + 0x4 + 0x1000;
//public int dwHeight; m_Height
//public int dwWidth; m_Width
private int dwPitchOrLinearSize;
private int dwMipMapCount = 0x1;
private int dwSize = 0x20;
private int dwFlags2;
private int dwFourCC;
private int dwRGBBitCount;
private int dwRBitMask;
private int dwGBitMask;
private int dwBBitMask;
private int dwABitMask;
private int dwCaps = 0x1000;
private int dwCaps2 = 0x0;
//DDS End
//PVR Start
private int pvrVersion = 0x03525650;
private int pvrFlags = 0x0;
private long pvrPixelFormat;
private int pvrColourSpace = 0x0;
private int pvrChannelType = 0x0;
//public int pvrHeight; m_Height
//public int pvrWidth; m_Width
private int pvrDepth = 0x1;
private int pvrNumSurfaces = 0x1; //For texture arrays
private int pvrNumFaces = 0x1; //For cube maps
//public int pvrMIPMapCount; dwMipMapCount
private int pvrMetaDataSize = 0x0;
//PVR End
//KTX Start
private int glType = 0;
private int glTypeSize = 1;
private int glFormat = 0;
private int glInternalFormat;
private int glBaseInternalFormat;
//public int pixelWidth; m_Width
//public int pixelHeight; m_Height
private int pixelDepth = 0;
private int numberOfArrayElements = 0;
private int numberOfFaces = 1;
private int numberOfMipmapLevels = 1;
private int bytesOfKeyValueData = 0;
//KTX End
//TextureConverter
private QFORMAT q_format;
//texgenpack
private texgenpack_texturetype texturetype;
private int[] version;
public Texture2D(AssetPreloadData preloadData, bool readSwitch)
{
var sourceFile = preloadData.sourceFile;
var reader = preloadData.Reader;
version = sourceFile.version;
if (sourceFile.platform == -2)
{
uint m_ObjectHideFlags = reader.ReadUInt32();
PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
PPtr m_PrefabInternal = sourceFile.ReadPPtr();
}
m_Name = reader.ReadAlignedString(reader.ReadInt32());
if (version[0] > 2017 || (version[0] == 2017 && version[1] >= 3))//2017.3 and up
{
var m_ForcedFallbackFormat = reader.ReadInt32();
var m_DownscaleFallback = reader.ReadBoolean();
reader.AlignStream(4);
}
m_Width = reader.ReadInt32();
m_Height = reader.ReadInt32();
m_CompleteImageSize = reader.ReadInt32();
m_TextureFormat = (TextureFormat)reader.ReadInt32();
if (version[0] < 5 || (version[0] == 5 && version[1] < 2))
{ m_MipMap = reader.ReadBoolean(); }
else
{
dwFlags += 0x20000;
dwMipMapCount = reader.ReadInt32();//is this with or without main image?
dwCaps += 0x400008;
}
m_IsReadable = reader.ReadBoolean(); //2.6.0 and up
m_ReadAllowed = reader.ReadBoolean(); //3.0.0 - 5.4
reader.AlignStream(4);
m_ImageCount = reader.ReadInt32();
m_TextureDimension = reader.ReadInt32();
//m_TextureSettings
m_FilterMode = reader.ReadInt32();
m_Aniso = reader.ReadInt32();
m_MipBias = reader.ReadSingle();
m_WrapMode = reader.ReadInt32();
if (version[0] >= 2017)//2017.x and up
{
int m_WrapV = reader.ReadInt32();
int m_WrapW = reader.ReadInt32();
}
if (version[0] >= 3)
{
m_LightmapFormat = reader.ReadInt32();
if (version[0] >= 4 || version[1] >= 5) { m_ColorSpace = reader.ReadInt32(); } //3.5.0 and up
}
image_data_size = reader.ReadInt32();
if (m_MipMap)
{
dwFlags += 0x20000;
dwMipMapCount = Convert.ToInt32(Math.Log(Math.Max(m_Width, m_Height)) / Math.Log(2));
dwCaps += 0x400008;
}
if (image_data_size == 0 && ((version[0] == 5 && version[1] >= 3) || version[0] > 5))//5.3.0 and up
{
offset = reader.ReadUInt32();
size = reader.ReadUInt32();
image_data_size = (int)size;
path = reader.ReadAlignedString(reader.ReadInt32());
}
if (readSwitch)
{
if (!string.IsNullOrEmpty(path))
{
var resourceFileName = Path.GetFileName(path);
var resourceFilePath = Path.GetDirectoryName(sourceFile.filePath) + "\\" + resourceFileName;
if (!File.Exists(resourceFilePath))
{
var findFiles = Directory.GetFiles(Path.GetDirectoryName(sourceFile.filePath), resourceFileName, SearchOption.AllDirectories);
if (findFiles.Length > 0)
{
resourceFilePath = findFiles[0];
}
}
if (File.Exists(resourceFilePath))
{
using (var resourceReader = new BinaryReader(File.OpenRead(resourceFilePath)))
{
resourceReader.BaseStream.Position = offset;
image_data = resourceReader.ReadBytes(image_data_size);
}
}
else
{
if (Studio.resourceFileReaders.TryGetValue(resourceFileName.ToUpper(), out var resourceReader))
{
resourceReader.Position = offset;
image_data = resourceReader.ReadBytes(image_data_size);
}
else
{
MessageBox.Show($"can't find the resource file {resourceFileName}");
}
}
}
else
{
image_data = reader.ReadBytes(image_data_size);
}
switch (m_TextureFormat)
{
//TODO 导出到DDS容器时应该用原像素还是转换以后的像素
case TextureFormat.Alpha8: //test pass
{
/*dwFlags2 = 0x2;
dwRGBBitCount = 0x8;
dwRBitMask = 0x0;
dwGBitMask = 0x0;
dwBBitMask = 0x0;
dwABitMask = 0xFF; */
//转BGRA32
var BGRA32 = Enumerable.Repeat<byte>(0xFF, image_data_size * 4).ToArray();
for (var i = 0; i < image_data_size; i++)
{
BGRA32[i * 4 + 3] = image_data[i];
}
SetBGRA32Info(BGRA32);
break;
}
case TextureFormat.ARGB4444: //test pass
{
SwapBytesForXbox(sourceFile.platform);
/*dwFlags2 = 0x41;
dwRGBBitCount = 0x10;
dwRBitMask = 0xF00;
dwGBitMask = 0xF0;
dwBBitMask = 0xF;
dwABitMask = 0xF000;*/
//转BGRA32
var BGRA32 = new byte[image_data_size * 2];
for (var i = 0; i < image_data_size / 2; i++)
{
var pixelNew = new byte[4];
var pixelOldShort = BitConverter.ToUInt16(image_data, i * 2);
pixelNew[0] = (byte)(pixelOldShort & 0x000f);
pixelNew[1] = (byte)((pixelOldShort & 0x00f0) >> 4);
pixelNew[2] = (byte)((pixelOldShort & 0x0f00) >> 8);
pixelNew[3] = (byte)((pixelOldShort & 0xf000) >> 12);
// convert range
for (var j = 0; j < 4; j++)
pixelNew[j] = (byte)((pixelNew[j] << 4) | pixelNew[j]);
pixelNew.CopyTo(BGRA32, i * 4);
}
SetBGRA32Info(BGRA32);
break;
}
case TextureFormat.RGB24: //test pass
{
/*dwFlags2 = 0x40;
dwRGBBitCount = 0x18;
dwRBitMask = 0xFF;
dwGBitMask = 0xFF00;
dwBBitMask = 0xFF0000;
dwABitMask = 0x0;*/
//转BGRA32
var BGRA32 = new byte[image_data_size / 3 * 4];
for (var i = 0; i < image_data_size / 3; i++)
{
BGRA32[i * 4] = image_data[i * 3 + 2];
BGRA32[i * 4 + 1] = image_data[i * 3 + 1];
BGRA32[i * 4 + 2] = image_data[i * 3 + 0];
BGRA32[i * 4 + 3] = 255;
}
SetBGRA32Info(BGRA32);
break;
}
case TextureFormat.RGBA32: //test pass
{
/*dwFlags2 = 0x41;
dwRGBBitCount = 0x20;
dwRBitMask = 0xFF;
dwGBitMask = 0xFF00;
dwBBitMask = 0xFF0000;
dwABitMask = -16777216;*/
//转BGRA32
var BGRA32 = new byte[image_data_size];
for (var i = 0; i < image_data_size; i += 4)
{
BGRA32[i] = image_data[i + 2];
BGRA32[i + 1] = image_data[i + 1];
BGRA32[i + 2] = image_data[i + 0];
BGRA32[i + 3] = image_data[i + 3];
}
SetBGRA32Info(BGRA32);
break;
}
case TextureFormat.ARGB32://test pass
{
/*dwFlags2 = 0x41;
dwRGBBitCount = 0x20;
dwRBitMask = 0xFF00;
dwGBitMask = 0xFF0000;
dwBBitMask = -16777216;
dwABitMask = 0xFF;*/
//转BGRA32
var BGRA32 = new byte[image_data_size];
for (var i = 0; i < image_data_size; i += 4)
{
BGRA32[i] = image_data[i + 3];
BGRA32[i + 1] = image_data[i + 2];
BGRA32[i + 2] = image_data[i + 1];
BGRA32[i + 3] = image_data[i + 0];
}
SetBGRA32Info(BGRA32);
break;
}
case TextureFormat.RGB565: //test pass
{
SwapBytesForXbox(sourceFile.platform);
dwFlags2 = 0x40;
dwRGBBitCount = 0x10;
dwRBitMask = 0xF800;
dwGBitMask = 0x7E0;
dwBBitMask = 0x1F;
dwABitMask = 0x0;
break;
}
case TextureFormat.R16: //test pass
{
//转BGRA32
var BGRA32 = new byte[image_data_size * 2];
for (var i = 0; i < image_data_size; i += 2)
{
float f = Half.ToHalf(image_data, i);
BGRA32[i * 2 + 2] = (byte)Math.Ceiling(f * 255);//R
BGRA32[i * 2 + 3] = 255;//A
}
SetBGRA32Info(BGRA32);
break;
}
case TextureFormat.DXT1: //test pass
case TextureFormat.DXT1Crunched: //test pass
{
SwapBytesForXbox(sourceFile.platform);
if (m_MipMap) { dwPitchOrLinearSize = m_Height * m_Width / 2; }
dwFlags2 = 0x4;
dwFourCC = 0x31545844;
dwRGBBitCount = 0x0;
dwRBitMask = 0x0;
dwGBitMask = 0x0;
dwBBitMask = 0x0;
dwABitMask = 0x0;
q_format = QFORMAT.Q_FORMAT_S3TC_DXT1_RGB;
break;
}
case TextureFormat.DXT5: //test pass
case TextureFormat.DXT5Crunched: //test pass
{
SwapBytesForXbox(sourceFile.platform);
if (m_MipMap) { dwPitchOrLinearSize = m_Height * m_Width / 2; }
dwFlags2 = 0x4;
dwFourCC = 0x35545844;
dwRGBBitCount = 0x0;
dwRBitMask = 0x0;
dwGBitMask = 0x0;
dwBBitMask = 0x0;
dwABitMask = 0x0;
q_format = QFORMAT.Q_FORMAT_S3TC_DXT5_RGBA;
break;
}
case TextureFormat.RGBA4444: //test pass
{
/*dwFlags2 = 0x41;
dwRGBBitCount = 0x10;
dwRBitMask = 0xF000;
dwGBitMask = 0xF00;
dwBBitMask = 0xF0;
dwABitMask = 0xF;*/
//转BGRA32
var BGRA32 = new byte[image_data_size * 2];
for (var i = 0; i < image_data_size / 2; i++)
{
var pixelNew = new byte[4];
var pixelOldShort = BitConverter.ToUInt16(image_data, i * 2);
pixelNew[0] = (byte)((pixelOldShort & 0x00f0) >> 4);
pixelNew[1] = (byte)((pixelOldShort & 0x0f00) >> 8);
pixelNew[2] = (byte)((pixelOldShort & 0xf000) >> 12);
pixelNew[3] = (byte)(pixelOldShort & 0x000f);
// convert range
for (var j = 0; j < 4; j++)
pixelNew[j] = (byte)((pixelNew[j] << 4) | pixelNew[j]);
pixelNew.CopyTo(BGRA32, i * 4);
}
SetBGRA32Info(BGRA32);
break;
}
case TextureFormat.BGRA32: //test pass
{
dwFlags2 = 0x41;
dwRGBBitCount = 0x20;
dwRBitMask = 0xFF0000;
dwGBitMask = 0xFF00;
dwBBitMask = 0xFF;
dwABitMask = -16777216;
break;
}
case TextureFormat.RHalf: //test pass
{
q_format = QFORMAT.Q_FORMAT_R_16F;
glInternalFormat = KTXHeader.GL_R16F;
glBaseInternalFormat = KTXHeader.GL_RED;
break;
}
case TextureFormat.RGHalf: //test pass
{
q_format = QFORMAT.Q_FORMAT_RG_HF;
glInternalFormat = KTXHeader.GL_RG16F;
glBaseInternalFormat = KTXHeader.GL_RG;
break;
}
case TextureFormat.RGBAHalf: //test pass
{
q_format = QFORMAT.Q_FORMAT_RGBA_HF;
glInternalFormat = KTXHeader.GL_RGBA16F;
glBaseInternalFormat = KTXHeader.GL_RGBA;
break;
}
case TextureFormat.RFloat: //test pass
{
q_format = QFORMAT.Q_FORMAT_R_F;
glInternalFormat = KTXHeader.GL_R32F;
glBaseInternalFormat = KTXHeader.GL_RED;
break;
}
case TextureFormat.RGFloat: //test pass
{
q_format = QFORMAT.Q_FORMAT_RG_F;
glInternalFormat = KTXHeader.GL_RG32F;
glBaseInternalFormat = KTXHeader.GL_RG;
break;
}
case TextureFormat.RGBAFloat: //test pass
{
q_format = QFORMAT.Q_FORMAT_RGBA_F;
glInternalFormat = KTXHeader.GL_RGBA32F;
glBaseInternalFormat = KTXHeader.GL_RGBA;
break;
}
case TextureFormat.YUY2: //test pass
{
pvrPixelFormat = 17;
break;
}
case TextureFormat.RGB9e5Float:
{
q_format = QFORMAT.Q_FORMAT_RGB9_E5;
break;
}
case TextureFormat.BC4: //test pass
{
texturetype = texgenpack_texturetype.RGTC1;
glInternalFormat = KTXHeader.GL_COMPRESSED_RED_RGTC1;
glBaseInternalFormat = KTXHeader.GL_RED;
break;
}
case TextureFormat.BC5: //test pass
{
texturetype = texgenpack_texturetype.RGTC2;
glInternalFormat = KTXHeader.GL_COMPRESSED_RG_RGTC2;
glBaseInternalFormat = KTXHeader.GL_RG;
break;
}
case TextureFormat.BC6H: //test pass
{
texturetype = texgenpack_texturetype.BPTC_FLOAT;
glInternalFormat = KTXHeader.GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT;
glBaseInternalFormat = KTXHeader.GL_RGB;
break;
}
case TextureFormat.BC7: //test pass
{
texturetype = texgenpack_texturetype.BPTC;
glInternalFormat = KTXHeader.GL_COMPRESSED_RGBA_BPTC_UNORM;
glBaseInternalFormat = KTXHeader.GL_RGBA;
break;
}
case TextureFormat.PVRTC_RGB2: //test pass
{
pvrPixelFormat = 0;
glInternalFormat = KTXHeader.GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
glBaseInternalFormat = KTXHeader.GL_RGB;
break;
}
case TextureFormat.PVRTC_RGBA2: //test pass
{
pvrPixelFormat = 1;
glInternalFormat = KTXHeader.GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;
glBaseInternalFormat = KTXHeader.GL_RGBA;
break;
}
case TextureFormat.PVRTC_RGB4: //test pass
{
pvrPixelFormat = 2;
glInternalFormat = KTXHeader.GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
glBaseInternalFormat = KTXHeader.GL_RGB;
break;
}
case TextureFormat.PVRTC_RGBA4: //test pass
{
pvrPixelFormat = 3;
glInternalFormat = KTXHeader.GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
glBaseInternalFormat = KTXHeader.GL_RGBA;
break;
}
case TextureFormat.ETC_RGB4Crunched:
case TextureFormat.ETC_RGB4_3DS: //test pass
case TextureFormat.ETC_RGB4: //test pass
{
pvrPixelFormat = 6;
glInternalFormat = KTXHeader.GL_ETC1_RGB8_OES;
glBaseInternalFormat = KTXHeader.GL_RGB;
break;
}
case TextureFormat.ATC_RGB4: //test pass
{
q_format = QFORMAT.Q_FORMAT_ATITC_RGB;
glInternalFormat = KTXHeader.GL_ATC_RGB_AMD;
glBaseInternalFormat = KTXHeader.GL_RGB;
break;
}
case TextureFormat.ATC_RGBA8: //test pass
{
q_format = QFORMAT.Q_FORMAT_ATC_RGBA_INTERPOLATED_ALPHA;
glInternalFormat = KTXHeader.GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD;
glBaseInternalFormat = KTXHeader.GL_RGBA;
break;
}
case TextureFormat.EAC_R: //test pass
{
q_format = QFORMAT.Q_FORMAT_EAC_R_UNSIGNED;
glInternalFormat = KTXHeader.GL_COMPRESSED_R11_EAC;
glBaseInternalFormat = KTXHeader.GL_RED;
break;
}
case TextureFormat.EAC_R_SIGNED: //test pass
{
q_format = QFORMAT.Q_FORMAT_EAC_R_SIGNED;
glInternalFormat = KTXHeader.GL_COMPRESSED_SIGNED_R11_EAC;
glBaseInternalFormat = KTXHeader.GL_RED;
break;
}
case TextureFormat.EAC_RG: //test pass
{
q_format = QFORMAT.Q_FORMAT_EAC_RG_UNSIGNED;
glInternalFormat = KTXHeader.GL_COMPRESSED_RG11_EAC;
glBaseInternalFormat = KTXHeader.GL_RG;
break;
}
case TextureFormat.EAC_RG_SIGNED: //test pass
{
q_format = QFORMAT.Q_FORMAT_EAC_RG_SIGNED;
glInternalFormat = KTXHeader.GL_COMPRESSED_SIGNED_RG11_EAC;
glBaseInternalFormat = KTXHeader.GL_RG;
break;
}
case TextureFormat.ETC2_RGB: //test pass
{
pvrPixelFormat = 22;
glInternalFormat = KTXHeader.GL_COMPRESSED_RGB8_ETC2;
glBaseInternalFormat = KTXHeader.GL_RGB;
break;
}
case TextureFormat.ETC2_RGBA1: //test pass
{
pvrPixelFormat = 24;
glInternalFormat = KTXHeader.GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2;
glBaseInternalFormat = KTXHeader.GL_RGBA;
break;
}
case TextureFormat.ETC2_RGBA8Crunched:
case TextureFormat.ETC_RGBA8_3DS: //test pass
case TextureFormat.ETC2_RGBA8: //test pass
{
pvrPixelFormat = 23;
glInternalFormat = KTXHeader.GL_COMPRESSED_RGBA8_ETC2_EAC;
glBaseInternalFormat = KTXHeader.GL_RGBA;
break;
}
case TextureFormat.ASTC_RGB_4x4: //test pass
case TextureFormat.ASTC_RGBA_4x4: //test pass
{
pvrPixelFormat = 27;
break;
}
case TextureFormat.ASTC_RGB_5x5: //test pass
case TextureFormat.ASTC_RGBA_5x5: //test pass
{
pvrPixelFormat = 29;
break;
}
case TextureFormat.ASTC_RGB_6x6: //test pass
case TextureFormat.ASTC_RGBA_6x6: //test pass
{
pvrPixelFormat = 31;
break;
}
case TextureFormat.ASTC_RGB_8x8: //test pass
case TextureFormat.ASTC_RGBA_8x8: //test pass
{
pvrPixelFormat = 34;
break;
}
case TextureFormat.ASTC_RGB_10x10: //test pass
case TextureFormat.ASTC_RGBA_10x10: //test pass
{
pvrPixelFormat = 38;
break;
}
case TextureFormat.ASTC_RGB_12x12: //test pass
case TextureFormat.ASTC_RGBA_12x12: //test pass
{
pvrPixelFormat = 40;
break;
}
case TextureFormat.RG16: //test pass
{
//转BGRA32
var BGRA32 = new byte[image_data_size * 2];
for (var i = 0; i < image_data_size; i += 2)
{
BGRA32[i * 2 + 1] = image_data[i + 1];//G
BGRA32[i * 2 + 2] = image_data[i];//R
BGRA32[i * 2 + 3] = 255;//A
}
SetBGRA32Info(BGRA32);
break;
}
case TextureFormat.R8: //test pass
{
//转BGRA32
var BGRA32 = new byte[image_data_size * 4];
for (var i = 0; i < image_data_size; i++)
{
BGRA32[i * 4 + 2] = image_data[i];//R
BGRA32[i * 4 + 3] = 255;//A
}
SetBGRA32Info(BGRA32);
break;
}
}
}
else
{
preloadData.InfoText = $"Width: {m_Width}\nHeight: {m_Height}\nFormat: ";
string type = m_TextureFormat.ToString();
preloadData.InfoText += type;
switch (m_TextureFormat)
{
case TextureFormat.Alpha8:
case TextureFormat.ARGB4444:
case TextureFormat.RGB24:
case TextureFormat.RGBA32:
case TextureFormat.ARGB32:
case TextureFormat.RGB565:
case TextureFormat.R16:
case TextureFormat.DXT1:
case TextureFormat.DXT5:
case TextureFormat.RGBA4444:
case TextureFormat.BGRA32:
case TextureFormat.RG16:
case TextureFormat.R8:
preloadData.extension = ".dds"; break;
case TextureFormat.DXT1Crunched:
case TextureFormat.DXT5Crunched:
case TextureFormat.ETC_RGB4Crunched:
case TextureFormat.ETC2_RGBA8Crunched:
preloadData.extension = ".crn"; break;
case TextureFormat.YUY2:
case TextureFormat.PVRTC_RGB2:
case TextureFormat.PVRTC_RGBA2:
case TextureFormat.PVRTC_RGB4:
case TextureFormat.PVRTC_RGBA4:
case TextureFormat.ETC_RGB4:
case TextureFormat.ETC2_RGB:
case TextureFormat.ETC2_RGBA1:
case TextureFormat.ETC2_RGBA8:
case TextureFormat.ASTC_RGB_4x4:
case TextureFormat.ASTC_RGB_5x5:
case TextureFormat.ASTC_RGB_6x6:
case TextureFormat.ASTC_RGB_8x8:
case TextureFormat.ASTC_RGB_10x10:
case TextureFormat.ASTC_RGB_12x12:
case TextureFormat.ASTC_RGBA_4x4:
case TextureFormat.ASTC_RGBA_5x5:
case TextureFormat.ASTC_RGBA_6x6:
case TextureFormat.ASTC_RGBA_8x8:
case TextureFormat.ASTC_RGBA_10x10:
case TextureFormat.ASTC_RGBA_12x12:
case TextureFormat.ETC_RGB4_3DS:
case TextureFormat.ETC_RGBA8_3DS:
preloadData.extension = ".pvr"; break;
case TextureFormat.RHalf:
case TextureFormat.RGHalf:
case TextureFormat.RGBAHalf:
case TextureFormat.RFloat:
case TextureFormat.RGFloat:
case TextureFormat.RGBAFloat:
case TextureFormat.BC4:
case TextureFormat.BC5:
case TextureFormat.BC6H:
case TextureFormat.BC7:
case TextureFormat.ATC_RGB4:
case TextureFormat.ATC_RGBA8:
case TextureFormat.EAC_R:
case TextureFormat.EAC_R_SIGNED:
case TextureFormat.EAC_RG:
case TextureFormat.EAC_RG_SIGNED:
preloadData.extension = ".ktx"; break;
default:
preloadData.extension = ".tex"; break;
}
switch (m_FilterMode)
{
case 0: preloadData.InfoText += "\nFilter Mode: Point "; break;
case 1: preloadData.InfoText += "\nFilter Mode: Bilinear "; break;
case 2: preloadData.InfoText += "\nFilter Mode: Trilinear "; break;
}
preloadData.InfoText += $"\nAnisotropic level: {m_Aniso}\nMip map bias: {m_MipBias}";
switch (m_WrapMode)
{
case 0: preloadData.InfoText += "\nWrap mode: Repeat"; break;
case 1: preloadData.InfoText += "\nWrap mode: Clamp"; break;
}
preloadData.Text = m_Name;
if (!string.IsNullOrEmpty(path))
preloadData.fullSize = preloadData.Size + (int)size;
}
}
private void SwapBytesForXbox(int platform)
{
if (platform == 11) //swap bytes for Xbox confirmed, PS3 not encountered
{
for (var i = 0; i < image_data_size / 2; i++)
{
var b0 = image_data[i * 2];
image_data[i * 2] = image_data[i * 2 + 1];
image_data[i * 2 + 1] = b0;
}
}
}
private void SetBGRA32Info(byte[] BGRA32)
{
image_data = BGRA32;
image_data_size = BGRA32.Length;
dwFlags2 = 0x41;
dwRGBBitCount = 0x20;
dwRBitMask = 0xFF0000;
dwGBitMask = 0xFF00;
dwBBitMask = 0xFF;
dwABitMask = -16777216;
}
}
}

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UnityStudio
{
public class Transform
{
public PPtr m_GameObject = new PPtr();
public float[] m_LocalRotation;
public float[] m_LocalPosition;
public float[] m_LocalScale;
public List<PPtr> m_Children = new List<PPtr>();
public PPtr m_Father = new PPtr();//can be transform or type 224 (as seen in Minions)
public Transform(AssetPreloadData preloadData)
{
var sourceFile = preloadData.sourceFile;
var reader = preloadData.Reader;
if (sourceFile.platform == -2)
{
uint m_ObjectHideFlags = reader.ReadUInt32();
PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
PPtr m_PrefabInternal = sourceFile.ReadPPtr();
}
m_GameObject = sourceFile.ReadPPtr();
m_LocalRotation = new[] { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() };
m_LocalPosition = new[] { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() };
m_LocalScale = new[] { reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle() };
int m_ChildrenCount = reader.ReadInt32();
for (int j = 0; j < m_ChildrenCount; j++)
{
m_Children.Add(sourceFile.ReadPPtr());
}
m_Father = sourceFile.ReadPPtr();
}
}
}

View File

@@ -0,0 +1,102 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace UnityStudio
{
class VideoClip
{
public string m_Name;
public byte[] m_VideoData;
public VideoClip(AssetPreloadData preloadData, bool readSwitch)
{
var sourceFile = preloadData.sourceFile;
var reader = preloadData.Reader;
m_Name = reader.ReadAlignedString(reader.ReadInt32());
var m_OriginalPath = reader.ReadAlignedString(reader.ReadInt32());
var m_ProxyWidth = reader.ReadUInt32();
var m_ProxyHeight = reader.ReadUInt32();
var Width = reader.ReadUInt32();
var Height = reader.ReadUInt32();
if (sourceFile.version[0] >= 2017)//2017.x and up
{
var m_PixelAspecRatioNum = reader.ReadUInt32();
var m_PixelAspecRatioDen = reader.ReadUInt32();
}
var m_FrameRate = reader.ReadDouble();
var m_FrameCount = reader.ReadUInt64();
var m_Format = reader.ReadInt32();
//m_AudioChannelCount
var size = reader.ReadInt32();
reader.Position += size * 2;
reader.AlignStream(4);
//m_AudioSampleRate
size = reader.ReadInt32();
reader.Position += size * 4;
//m_AudioLanguage
size = reader.ReadInt32();
for (int i = 0; i < size; i++)
{
reader.ReadAlignedString(reader.ReadInt32());
}
//StreamedResource m_ExternalResources
var m_Source = reader.ReadAlignedString(reader.ReadInt32());
var m_Offset = reader.ReadUInt64();
var m_Size = reader.ReadUInt64();
var m_HasSplitAlpha = reader.ReadBoolean();
if (readSwitch)
{
if (!string.IsNullOrEmpty(m_Source))
{
var resourceFileName = Path.GetFileName(m_Source);
var resourceFilePath = Path.GetDirectoryName(sourceFile.filePath) + "\\" + resourceFileName;
if (!File.Exists(resourceFilePath))
{
var findFiles = Directory.GetFiles(Path.GetDirectoryName(sourceFile.filePath), resourceFileName, SearchOption.AllDirectories);
if (findFiles.Length > 0)
{
resourceFilePath = findFiles[0];
}
}
if (File.Exists(resourceFilePath))
{
using (var resourceReader = new BinaryReader(File.OpenRead(resourceFilePath)))
{
resourceReader.BaseStream.Position = (long)m_Offset;
m_VideoData = resourceReader.ReadBytes((int)m_Size);
}
}
else
{
if (Studio.resourceFileReaders.TryGetValue(resourceFileName.ToUpper(), out var resourceReader))
{
resourceReader.Position = (long)m_Offset;
m_VideoData = resourceReader.ReadBytes((int)m_Size);
}
else
{
MessageBox.Show($"can't find the resource file {resourceFileName}");
}
}
}
else
{
if (m_Size > 0)
m_VideoData = reader.ReadBytes((int)m_Size);
}
}
else
{
preloadData.extension = Path.GetExtension(m_OriginalPath);
preloadData.Text = m_Name;
preloadData.fullSize = preloadData.Size + (int)m_Size;
}
}
}
}

436
UnityStudio/ExportOptions.Designer.cs generated Normal file
View File

@@ -0,0 +1,436 @@
namespace UnityStudio
{
partial class ExportOptions
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.includeBox = new System.Windows.Forms.GroupBox();
this.convertDummies = new System.Windows.Forms.CheckBox();
this.embedBox = new System.Windows.Forms.CheckBox();
this.lightsBox = new System.Windows.Forms.CheckBox();
this.camerasBox = new System.Windows.Forms.CheckBox();
this.exportDeformers = new System.Windows.Forms.CheckBox();
this.geometryBox = new System.Windows.Forms.GroupBox();
this.exportColors = new System.Windows.Forms.CheckBox();
this.exportUVs = new System.Windows.Forms.CheckBox();
this.exportTangents = new System.Windows.Forms.CheckBox();
this.exportNormals = new System.Windows.Forms.CheckBox();
this.advancedBox = new System.Windows.Forms.GroupBox();
this.axisLabel = new System.Windows.Forms.Label();
this.upAxis = new System.Windows.Forms.ComboBox();
this.scaleFactor = new System.Windows.Forms.NumericUpDown();
this.scaleLabel = new System.Windows.Forms.Label();
this.fbxOKbutton = new System.Windows.Forms.Button();
this.fbxCancel = new System.Windows.Forms.Button();
this.showExpOpt = new System.Windows.Forms.CheckBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.convertAudio = new System.Windows.Forms.CheckBox();
this.panel1 = new System.Windows.Forms.Panel();
this.tojpg = new System.Windows.Forms.RadioButton();
this.topng = new System.Windows.Forms.RadioButton();
this.tobmp = new System.Windows.Forms.RadioButton();
this.converttexture = new System.Windows.Forms.CheckBox();
this.includeBox.SuspendLayout();
this.geometryBox.SuspendLayout();
this.advancedBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.scaleFactor)).BeginInit();
this.groupBox1.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// includeBox
//
this.includeBox.AutoSize = true;
this.includeBox.Controls.Add(this.convertDummies);
this.includeBox.Controls.Add(this.embedBox);
this.includeBox.Controls.Add(this.lightsBox);
this.includeBox.Controls.Add(this.camerasBox);
this.includeBox.Controls.Add(this.exportDeformers);
this.includeBox.Controls.Add(this.geometryBox);
this.includeBox.Location = new System.Drawing.Point(12, 12);
this.includeBox.Name = "includeBox";
this.includeBox.Size = new System.Drawing.Size(249, 267);
this.includeBox.TabIndex = 0;
this.includeBox.TabStop = false;
this.includeBox.Text = "Include";
//
// convertDummies
//
this.convertDummies.AutoSize = true;
this.convertDummies.Location = new System.Drawing.Point(14, 164);
this.convertDummies.Name = "convertDummies";
this.convertDummies.Size = new System.Drawing.Size(228, 16);
this.convertDummies.TabIndex = 5;
this.convertDummies.Text = "Convert Deforming Dummies to Bones";
this.convertDummies.UseVisualStyleBackColor = true;
this.convertDummies.CheckedChanged += new System.EventHandler(this.exportOpnions_CheckedChanged);
//
// embedBox
//
this.embedBox.AutoSize = true;
this.embedBox.Enabled = false;
this.embedBox.Location = new System.Drawing.Point(14, 230);
this.embedBox.Name = "embedBox";
this.embedBox.Size = new System.Drawing.Size(90, 16);
this.embedBox.TabIndex = 4;
this.embedBox.Text = "Embed Media";
this.embedBox.UseVisualStyleBackColor = true;
//
// lightsBox
//
this.lightsBox.AutoSize = true;
this.lightsBox.Enabled = false;
this.lightsBox.Location = new System.Drawing.Point(14, 208);
this.lightsBox.Name = "lightsBox";
this.lightsBox.Size = new System.Drawing.Size(60, 16);
this.lightsBox.TabIndex = 3;
this.lightsBox.Text = "Lights";
this.lightsBox.UseVisualStyleBackColor = true;
//
// camerasBox
//
this.camerasBox.AutoSize = true;
this.camerasBox.Enabled = false;
this.camerasBox.Location = new System.Drawing.Point(14, 186);
this.camerasBox.Name = "camerasBox";
this.camerasBox.Size = new System.Drawing.Size(66, 16);
this.camerasBox.TabIndex = 2;
this.camerasBox.Text = "Cameras";
this.camerasBox.UseVisualStyleBackColor = true;
//
// exportDeformers
//
this.exportDeformers.AutoSize = true;
this.exportDeformers.Location = new System.Drawing.Point(14, 142);
this.exportDeformers.Name = "exportDeformers";
this.exportDeformers.Size = new System.Drawing.Size(108, 16);
this.exportDeformers.TabIndex = 1;
this.exportDeformers.Text = "Skin Deformers";
this.exportDeformers.UseVisualStyleBackColor = true;
this.exportDeformers.CheckedChanged += new System.EventHandler(this.exportDeformers_CheckedChanged);
//
// geometryBox
//
this.geometryBox.AutoSize = true;
this.geometryBox.Controls.Add(this.exportColors);
this.geometryBox.Controls.Add(this.exportUVs);
this.geometryBox.Controls.Add(this.exportTangents);
this.geometryBox.Controls.Add(this.exportNormals);
this.geometryBox.Location = new System.Drawing.Point(7, 18);
this.geometryBox.Name = "geometryBox";
this.geometryBox.Size = new System.Drawing.Size(235, 122);
this.geometryBox.TabIndex = 0;
this.geometryBox.TabStop = false;
this.geometryBox.Text = "Geometry";
//
// exportColors
//
this.exportColors.AutoSize = true;
this.exportColors.Checked = true;
this.exportColors.CheckState = System.Windows.Forms.CheckState.Checked;
this.exportColors.Location = new System.Drawing.Point(7, 85);
this.exportColors.Name = "exportColors";
this.exportColors.Size = new System.Drawing.Size(102, 16);
this.exportColors.TabIndex = 3;
this.exportColors.Text = "Vertex Colors";
this.exportColors.UseVisualStyleBackColor = true;
this.exportColors.CheckedChanged += new System.EventHandler(this.exportOpnions_CheckedChanged);
//
// exportUVs
//
this.exportUVs.AutoSize = true;
this.exportUVs.Checked = true;
this.exportUVs.CheckState = System.Windows.Forms.CheckState.Checked;
this.exportUVs.Location = new System.Drawing.Point(7, 63);
this.exportUVs.Name = "exportUVs";
this.exportUVs.Size = new System.Drawing.Size(108, 16);
this.exportUVs.TabIndex = 2;
this.exportUVs.Text = "UV Coordinates";
this.exportUVs.UseVisualStyleBackColor = true;
this.exportUVs.CheckedChanged += new System.EventHandler(this.exportOpnions_CheckedChanged);
//
// exportTangents
//
this.exportTangents.AutoSize = true;
this.exportTangents.Location = new System.Drawing.Point(7, 41);
this.exportTangents.Name = "exportTangents";
this.exportTangents.Size = new System.Drawing.Size(72, 16);
this.exportTangents.TabIndex = 1;
this.exportTangents.Text = "Tangents";
this.exportTangents.UseVisualStyleBackColor = true;
this.exportTangents.CheckedChanged += new System.EventHandler(this.exportOpnions_CheckedChanged);
//
// exportNormals
//
this.exportNormals.AutoSize = true;
this.exportNormals.Checked = true;
this.exportNormals.CheckState = System.Windows.Forms.CheckState.Checked;
this.exportNormals.Location = new System.Drawing.Point(7, 18);
this.exportNormals.Name = "exportNormals";
this.exportNormals.Size = new System.Drawing.Size(66, 16);
this.exportNormals.TabIndex = 0;
this.exportNormals.Text = "Normals";
this.exportNormals.UseVisualStyleBackColor = true;
this.exportNormals.CheckedChanged += new System.EventHandler(this.exportOpnions_CheckedChanged);
//
// advancedBox
//
this.advancedBox.AutoSize = true;
this.advancedBox.Controls.Add(this.axisLabel);
this.advancedBox.Controls.Add(this.upAxis);
this.advancedBox.Controls.Add(this.scaleFactor);
this.advancedBox.Controls.Add(this.scaleLabel);
this.advancedBox.Location = new System.Drawing.Point(12, 284);
this.advancedBox.Name = "advancedBox";
this.advancedBox.Size = new System.Drawing.Size(249, 78);
this.advancedBox.TabIndex = 5;
this.advancedBox.TabStop = false;
this.advancedBox.Text = "Advanced Options";
//
// axisLabel
//
this.axisLabel.AutoSize = true;
this.axisLabel.Location = new System.Drawing.Point(6, 40);
this.axisLabel.Name = "axisLabel";
this.axisLabel.Size = new System.Drawing.Size(53, 12);
this.axisLabel.TabIndex = 3;
this.axisLabel.Text = "Up Axis:";
//
// upAxis
//
this.upAxis.FormattingEnabled = true;
this.upAxis.Items.AddRange(new object[] {
"Y-up"});
this.upAxis.Location = new System.Drawing.Point(66, 38);
this.upAxis.MaxDropDownItems = 2;
this.upAxis.Name = "upAxis";
this.upAxis.Size = new System.Drawing.Size(70, 20);
this.upAxis.TabIndex = 2;
//
// scaleFactor
//
this.scaleFactor.DecimalPlaces = 2;
this.scaleFactor.Increment = new decimal(new int[] {
1,
0,
0,
131072});
this.scaleFactor.Location = new System.Drawing.Point(96, 14);
this.scaleFactor.Name = "scaleFactor";
this.scaleFactor.Size = new System.Drawing.Size(46, 21);
this.scaleFactor.TabIndex = 1;
this.scaleFactor.Value = new decimal(new int[] {
254,
0,
0,
131072});
//
// scaleLabel
//
this.scaleLabel.AutoSize = true;
this.scaleLabel.Location = new System.Drawing.Point(6, 15);
this.scaleLabel.Name = "scaleLabel";
this.scaleLabel.Size = new System.Drawing.Size(83, 12);
this.scaleLabel.TabIndex = 0;
this.scaleLabel.Text = "Scale Factor:";
//
// fbxOKbutton
//
this.fbxOKbutton.Location = new System.Drawing.Point(332, 364);
this.fbxOKbutton.Name = "fbxOKbutton";
this.fbxOKbutton.Size = new System.Drawing.Size(75, 21);
this.fbxOKbutton.TabIndex = 6;
this.fbxOKbutton.Text = "OK";
this.fbxOKbutton.UseVisualStyleBackColor = true;
this.fbxOKbutton.Click += new System.EventHandler(this.fbxOKbutton_Click);
//
// fbxCancel
//
this.fbxCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.fbxCancel.Location = new System.Drawing.Point(420, 364);
this.fbxCancel.Name = "fbxCancel";
this.fbxCancel.Size = new System.Drawing.Size(75, 21);
this.fbxCancel.TabIndex = 7;
this.fbxCancel.Text = "Cancel";
this.fbxCancel.UseVisualStyleBackColor = true;
this.fbxCancel.Click += new System.EventHandler(this.fbxCancel_Click);
//
// showExpOpt
//
this.showExpOpt.AutoSize = true;
this.showExpOpt.Location = new System.Drawing.Point(12, 367);
this.showExpOpt.Name = "showExpOpt";
this.showExpOpt.Size = new System.Drawing.Size(222, 16);
this.showExpOpt.TabIndex = 8;
this.showExpOpt.Text = "Show this dialog for every export";
this.showExpOpt.UseVisualStyleBackColor = true;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.convertAudio);
this.groupBox1.Controls.Add(this.panel1);
this.groupBox1.Controls.Add(this.converttexture);
this.groupBox1.Location = new System.Drawing.Point(267, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(228, 349);
this.groupBox1.TabIndex = 9;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Convert";
//
// convertAudio
//
this.convertAudio.AutoSize = true;
this.convertAudio.Checked = true;
this.convertAudio.CheckState = System.Windows.Forms.CheckState.Checked;
this.convertAudio.Location = new System.Drawing.Point(8, 81);
this.convertAudio.Name = "convertAudio";
this.convertAudio.Size = new System.Drawing.Size(198, 28);
this.convertAudio.TabIndex = 6;
this.convertAudio.Text = "Convert AudioClip to WAV(PCM)\r\n(If support)";
this.convertAudio.UseVisualStyleBackColor = true;
//
// panel1
//
this.panel1.Controls.Add(this.tojpg);
this.panel1.Controls.Add(this.topng);
this.panel1.Controls.Add(this.tobmp);
this.panel1.Location = new System.Drawing.Point(30, 42);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(146, 30);
this.panel1.TabIndex = 5;
//
// tojpg
//
this.tojpg.AutoSize = true;
this.tojpg.Location = new System.Drawing.Point(97, 6);
this.tojpg.Name = "tojpg";
this.tojpg.Size = new System.Drawing.Size(47, 16);
this.tojpg.TabIndex = 4;
this.tojpg.Text = "JPEG";
this.tojpg.UseVisualStyleBackColor = true;
//
// topng
//
this.topng.AutoSize = true;
this.topng.Checked = true;
this.topng.Location = new System.Drawing.Point(50, 6);
this.topng.Name = "topng";
this.topng.Size = new System.Drawing.Size(41, 16);
this.topng.TabIndex = 3;
this.topng.TabStop = true;
this.topng.Text = "PNG";
this.topng.UseVisualStyleBackColor = true;
//
// tobmp
//
this.tobmp.AutoSize = true;
this.tobmp.Location = new System.Drawing.Point(3, 6);
this.tobmp.Name = "tobmp";
this.tobmp.Size = new System.Drawing.Size(41, 16);
this.tobmp.TabIndex = 2;
this.tobmp.Text = "BMP";
this.tobmp.UseVisualStyleBackColor = true;
//
// converttexture
//
this.converttexture.AutoSize = true;
this.converttexture.Checked = true;
this.converttexture.CheckState = System.Windows.Forms.CheckState.Checked;
this.converttexture.Location = new System.Drawing.Point(8, 20);
this.converttexture.Name = "converttexture";
this.converttexture.Size = new System.Drawing.Size(192, 16);
this.converttexture.TabIndex = 1;
this.converttexture.Text = "Convert Texture (If support)";
this.converttexture.UseVisualStyleBackColor = true;
//
// ExportOptions
//
this.AcceptButton = this.fbxOKbutton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.fbxCancel;
this.ClientSize = new System.Drawing.Size(513, 392);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.showExpOpt);
this.Controls.Add(this.fbxCancel);
this.Controls.Add(this.fbxOKbutton);
this.Controls.Add(this.advancedBox);
this.Controls.Add(this.includeBox);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "ExportOptions";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Export options";
this.TopMost = true;
this.includeBox.ResumeLayout(false);
this.includeBox.PerformLayout();
this.geometryBox.ResumeLayout(false);
this.geometryBox.PerformLayout();
this.advancedBox.ResumeLayout(false);
this.advancedBox.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.scaleFactor)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.GroupBox includeBox;
private System.Windows.Forms.GroupBox advancedBox;
private System.Windows.Forms.NumericUpDown scaleFactor;
private System.Windows.Forms.Label scaleLabel;
private System.Windows.Forms.CheckBox embedBox;
private System.Windows.Forms.CheckBox lightsBox;
private System.Windows.Forms.CheckBox camerasBox;
private System.Windows.Forms.CheckBox exportDeformers;
private System.Windows.Forms.GroupBox geometryBox;
private System.Windows.Forms.CheckBox exportColors;
private System.Windows.Forms.CheckBox exportUVs;
private System.Windows.Forms.CheckBox exportTangents;
private System.Windows.Forms.CheckBox exportNormals;
private System.Windows.Forms.Label axisLabel;
private System.Windows.Forms.ComboBox upAxis;
private System.Windows.Forms.Button fbxOKbutton;
private System.Windows.Forms.Button fbxCancel;
private System.Windows.Forms.CheckBox showExpOpt;
private System.Windows.Forms.CheckBox convertDummies;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.CheckBox converttexture;
private System.Windows.Forms.RadioButton tojpg;
private System.Windows.Forms.RadioButton topng;
private System.Windows.Forms.RadioButton tobmp;
private System.Windows.Forms.CheckBox convertAudio;
private System.Windows.Forms.Panel panel1;
}
}

View File

@@ -0,0 +1,83 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace UnityStudio
{
public partial class ExportOptions : Form
{
public ExportOptions()
{
InitializeComponent();
exportNormals.Checked = (bool)Properties.Settings.Default["exportNormals"];
exportTangents.Checked = (bool)Properties.Settings.Default["exportTangents"];
exportUVs.Checked = (bool)Properties.Settings.Default["exportUVs"];
exportColors.Checked = (bool)Properties.Settings.Default["exportColors"];
exportDeformers.Checked = (bool)Properties.Settings.Default["exportDeformers"];
convertDummies.Checked = (bool)Properties.Settings.Default["convertDummies"];
convertDummies.Enabled = (bool)Properties.Settings.Default["exportDeformers"];
scaleFactor.Value = (decimal)Properties.Settings.Default["scaleFactor"];
upAxis.SelectedIndex = (int)Properties.Settings.Default["upAxis"];
showExpOpt.Checked = (bool)Properties.Settings.Default["showExpOpt"];
converttexture.Checked = (bool)Properties.Settings.Default["convertTexture"];
convertAudio.Checked = (bool)Properties.Settings.Default["convertAudio"];
var str = (string)Properties.Settings.Default["convertType"];
foreach (Control c in panel1.Controls)
{
if (c.Text == str)
{
((RadioButton)c).Checked = true;
break;
}
}
}
private void exportOpnions_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings.Default[((CheckBox)sender).Name] = ((CheckBox)sender).Checked;
Properties.Settings.Default.Save();
}
private void fbxOKbutton_Click(object sender, EventArgs e)
{
Properties.Settings.Default["exportNormals"] = exportNormals.Checked;
Properties.Settings.Default["exportTangents"] = exportTangents.Checked;
Properties.Settings.Default["exportUVs"] = exportUVs.Checked;
Properties.Settings.Default["exportColors"] = exportColors.Checked;
Properties.Settings.Default["exportDeformers"] = exportDeformers.Checked;
Properties.Settings.Default["scaleFactor"] = scaleFactor.Value;
Properties.Settings.Default["upAxis"] = upAxis.SelectedIndex;
Properties.Settings.Default["convertTexture"] = converttexture.Checked;
Properties.Settings.Default["convertAudio"] = convertAudio.Checked;
foreach (Control c in panel1.Controls)
{
if (((RadioButton)c).Checked)
{
Properties.Settings.Default["convertType"] = c.Text;
break;
}
}
Properties.Settings.Default.Save();
DialogResult = DialogResult.OK;
Close();
}
private void fbxCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
private void exportDeformers_CheckedChanged(object sender, EventArgs e)
{
exportOpnions_CheckedChanged(sender, e);
convertDummies.Enabled = exportDeformers.Checked;
}
}
}

View File

@@ -0,0 +1,120 @@
<?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>
</root>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,103 @@
/* =================================================================================================== */
/* FMOD Studio - Error string header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2016. */
/* */
/* Use this header if you want to store or display a string version / english explanation of */
/* the FMOD error codes. */
/* */
/* =================================================================================================== */
namespace FMOD
{
public class Error
{
public static string String(FMOD.RESULT errcode)
{
switch (errcode)
{
case FMOD.RESULT.OK: return "No errors.";
case FMOD.RESULT.ERR_BADCOMMAND: return "Tried to call a function on a data type that does not allow this type of functionality (ie calling Sound::lock on a streaming sound).";
case FMOD.RESULT.ERR_CHANNEL_ALLOC: return "Error trying to allocate a channel.";
case FMOD.RESULT.ERR_CHANNEL_STOLEN: return "The specified channel has been reused to play another sound.";
case FMOD.RESULT.ERR_DMA: return "DMA Failure. See debug output for more information.";
case FMOD.RESULT.ERR_DSP_CONNECTION: return "DSP connection error. Connection possibly caused a cyclic dependency or connected dsps with incompatible buffer counts.";
case FMOD.RESULT.ERR_DSP_DONTPROCESS: return "DSP return code from a DSP process query callback. Tells mixer not to call the process callback and therefore not consume CPU. Use this to optimize the DSP graph.";
case FMOD.RESULT.ERR_DSP_FORMAT: return "DSP Format error. A DSP unit may have attempted to connect to this network with the wrong format, or a matrix may have been set with the wrong size if the target unit has a specified channel map.";
case FMOD.RESULT.ERR_DSP_INUSE: return "DSP is already in the mixer's DSP network. It must be removed before being reinserted or released.";
case FMOD.RESULT.ERR_DSP_NOTFOUND: return "DSP connection error. Couldn't find the DSP unit specified.";
case FMOD.RESULT.ERR_DSP_RESERVED: return "DSP operation error. Cannot perform operation on this DSP as it is reserved by the system.";
case FMOD.RESULT.ERR_DSP_SILENCE: return "DSP return code from a DSP process query callback. Tells mixer silence would be produced from read, so go idle and not consume CPU. Use this to optimize the DSP graph.";
case FMOD.RESULT.ERR_DSP_TYPE: return "DSP operation cannot be performed on a DSP of this type.";
case FMOD.RESULT.ERR_FILE_BAD: return "Error loading file.";
case FMOD.RESULT.ERR_FILE_COULDNOTSEEK: return "Couldn't perform seek operation. This is a limitation of the medium (ie netstreams) or the file format.";
case FMOD.RESULT.ERR_FILE_DISKEJECTED: return "Media was ejected while reading.";
case FMOD.RESULT.ERR_FILE_EOF: return "End of file unexpectedly reached while trying to read essential data (truncated?).";
case FMOD.RESULT.ERR_FILE_ENDOFDATA: return "End of current chunk reached while trying to read data.";
case FMOD.RESULT.ERR_FILE_NOTFOUND: return "File not found.";
case FMOD.RESULT.ERR_FORMAT: return "Unsupported file or audio format.";
case FMOD.RESULT.ERR_HEADER_MISMATCH: return "There is a version mismatch between the FMOD header and either the FMOD Studio library or the FMOD Low Level library.";
case FMOD.RESULT.ERR_HTTP: return "A HTTP error occurred. This is a catch-all for HTTP errors not listed elsewhere.";
case FMOD.RESULT.ERR_HTTP_ACCESS: return "The specified resource requires authentication or is forbidden.";
case FMOD.RESULT.ERR_HTTP_PROXY_AUTH: return "Proxy authentication is required to access the specified resource.";
case FMOD.RESULT.ERR_HTTP_SERVER_ERROR: return "A HTTP server error occurred.";
case FMOD.RESULT.ERR_HTTP_TIMEOUT: return "The HTTP request timed out.";
case FMOD.RESULT.ERR_INITIALIZATION: return "FMOD was not initialized correctly to support this function.";
case FMOD.RESULT.ERR_INITIALIZED: return "Cannot call this command after System::init.";
case FMOD.RESULT.ERR_INTERNAL: return "An error occurred that wasn't supposed to. Contact support.";
case FMOD.RESULT.ERR_INVALID_FLOAT: return "Value passed in was a NaN, Inf or denormalized float.";
case FMOD.RESULT.ERR_INVALID_HANDLE: return "An invalid object handle was used.";
case FMOD.RESULT.ERR_INVALID_PARAM: return "An invalid parameter was passed to this function.";
case FMOD.RESULT.ERR_INVALID_POSITION: return "An invalid seek position was passed to this function.";
case FMOD.RESULT.ERR_INVALID_SPEAKER: return "An invalid speaker was passed to this function based on the current speaker mode.";
case FMOD.RESULT.ERR_INVALID_SYNCPOINT: return "The syncpoint did not come from this sound handle.";
case FMOD.RESULT.ERR_INVALID_THREAD: return "Tried to call a function on a thread that is not supported.";
case FMOD.RESULT.ERR_INVALID_VECTOR: return "The vectors passed in are not unit length, or perpendicular.";
case FMOD.RESULT.ERR_MAXAUDIBLE: return "Reached maximum audible playback count for this sound's soundgroup.";
case FMOD.RESULT.ERR_MEMORY: return "Not enough memory or resources.";
case FMOD.RESULT.ERR_MEMORY_CANTPOINT: return "Can't use FMOD_OPENMEMORY_POINT on non PCM source data, or non mp3/xma/adpcm data if FMOD_CREATECOMPRESSEDSAMPLE was used.";
case FMOD.RESULT.ERR_NEEDS3D: return "Tried to call a command on a 2d sound when the command was meant for 3d sound.";
case FMOD.RESULT.ERR_NEEDSHARDWARE: return "Tried to use a feature that requires hardware support.";
case FMOD.RESULT.ERR_NET_CONNECT: return "Couldn't connect to the specified host.";
case FMOD.RESULT.ERR_NET_SOCKET_ERROR: return "A socket error occurred. This is a catch-all for socket-related errors not listed elsewhere.";
case FMOD.RESULT.ERR_NET_URL: return "The specified URL couldn't be resolved.";
case FMOD.RESULT.ERR_NET_WOULD_BLOCK: return "Operation on a non-blocking socket could not complete immediately.";
case FMOD.RESULT.ERR_NOTREADY: return "Operation could not be performed because specified sound/DSP connection is not ready.";
case FMOD.RESULT.ERR_OUTPUT_ALLOCATED: return "Error initializing output device, but more specifically, the output device is already in use and cannot be reused.";
case FMOD.RESULT.ERR_OUTPUT_CREATEBUFFER: return "Error creating hardware sound buffer.";
case FMOD.RESULT.ERR_OUTPUT_DRIVERCALL: return "A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted.";
case FMOD.RESULT.ERR_OUTPUT_FORMAT: return "Soundcard does not support the specified format.";
case FMOD.RESULT.ERR_OUTPUT_INIT: return "Error initializing output device.";
case FMOD.RESULT.ERR_OUTPUT_NODRIVERS: return "The output device has no drivers installed. If pre-init, FMOD_OUTPUT_NOSOUND is selected as the output mode. If post-init, the function just fails.";
case FMOD.RESULT.ERR_PLUGIN: return "An unspecified error has been returned from a plugin.";
case FMOD.RESULT.ERR_PLUGIN_MISSING: return "A requested output, dsp unit type or codec was not available.";
case FMOD.RESULT.ERR_PLUGIN_RESOURCE: return "A resource that the plugin requires cannot be found. (ie the DLS file for MIDI playback)";
case FMOD.RESULT.ERR_PLUGIN_VERSION: return "A plugin was built with an unsupported SDK version.";
case FMOD.RESULT.ERR_RECORD: return "An error occurred trying to initialize the recording device.";
case FMOD.RESULT.ERR_REVERB_CHANNELGROUP: return "Reverb properties cannot be set on this channel because a parent channelgroup owns the reverb connection.";
case FMOD.RESULT.ERR_REVERB_INSTANCE: return "Specified instance in FMOD_REVERB_PROPERTIES couldn't be set. Most likely because it is an invalid instance number or the reverb doesn't exist.";
case FMOD.RESULT.ERR_SUBSOUNDS: return "The error occurred because the sound referenced contains subsounds when it shouldn't have, or it doesn't contain subsounds when it should have. The operation may also not be able to be performed on a parent sound.";
case FMOD.RESULT.ERR_SUBSOUND_ALLOCATED: return "This subsound is already being used by another sound, you cannot have more than one parent to a sound. Null out the other parent's entry first.";
case FMOD.RESULT.ERR_SUBSOUND_CANTMOVE: return "Shared subsounds cannot be replaced or moved from their parent stream, such as when the parent stream is an FSB file.";
case FMOD.RESULT.ERR_TAGNOTFOUND: return "The specified tag could not be found or there are no tags.";
case FMOD.RESULT.ERR_TOOMANYCHANNELS: return "The sound created exceeds the allowable input channel count. This can be increased using the 'maxinputchannels' parameter in System::setSoftwareFormat.";
case FMOD.RESULT.ERR_TRUNCATED: return "The retrieved string is too long to fit in the supplied buffer and has been truncated.";
case FMOD.RESULT.ERR_UNIMPLEMENTED: return "Something in FMOD hasn't been implemented when it should be! contact support!";
case FMOD.RESULT.ERR_UNINITIALIZED: return "This command failed because System::init or System::setDriver was not called.";
case FMOD.RESULT.ERR_UNSUPPORTED: return "A command issued was not supported by this object. Possibly a plugin without certain callbacks specified.";
case FMOD.RESULT.ERR_VERSION: return "The version number of this file format is not supported.";
case FMOD.RESULT.ERR_EVENT_ALREADY_LOADED: return "The specified bank has already been loaded.";
case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_BUSY: return "The live update connection failed due to the game already being connected.";
case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_MISMATCH: return "The live update connection failed due to the game data being out of sync with the tool.";
case FMOD.RESULT.ERR_EVENT_LIVEUPDATE_TIMEOUT: return "The live update connection timed out.";
case FMOD.RESULT.ERR_EVENT_NOTFOUND: return "The requested event, bus or vca could not be found.";
case FMOD.RESULT.ERR_STUDIO_UNINITIALIZED: return "The Studio::System object is not yet initialized.";
case FMOD.RESULT.ERR_STUDIO_NOT_LOADED: return "The specified resource is not loaded, so it can't be unloaded.";
case FMOD.RESULT.ERR_INVALID_STRING: return "An invalid string was passed to this function.";
case FMOD.RESULT.ERR_ALREADY_LOCKED: return "The specified resource is already locked.";
case FMOD.RESULT.ERR_NOT_LOCKED: return "The specified resource is not locked, so it can't be unlocked.";
case FMOD.RESULT.ERR_RECORD_DISCONNECTED: return "The specified recording driver has been disconnected.";
case FMOD.RESULT.ERR_TOOMANYSAMPLES: return "The length provided exceed the allowable limit.";
default: return "Unknown error.";
}
}
}
}

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace UnityStudio
{
public class GOHierarchy : TreeView
{
protected override void WndProc(ref Message m)
{
// Filter WM_LBUTTONDBLCLK
if (m.Msg != 0x203) base.WndProc(ref m);
}
}
}

View File

@@ -0,0 +1,539 @@
#define CHECK_ARGS
#define CHECK_EOF
//#define LOCAL_SHADOW
using System;
using System.IO;
namespace Lz4
{
public class Lz4DecoderStream : Stream
{
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;
phase = DecodePhase.ReadToken;
decodeBufferPos = 0;
litLen = 0;
matLen = 0;
matDst = 0;
inBufPos = DecBufLen;
inBufEnd = DecBufLen;
}
protected override void Dispose(bool disposing)
{
try
{
if (disposing && input != null)
{
input.Close();
}
input = null;
}
finally
{
base.Dispose(disposing);
}
}
private long inputLength;
private Stream input;
//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 DecBufLen = 0x10000;
private const int DecBufMask = 0xFFFF;
private const int InBufLen = 128;
private byte[] decodeBuffer = new byte[DecBufLen + InBufLen];
private int decodeBufferPos, inBufPos, inBufEnd;
//we keep track of which phase we're in so that we can jump right back
//into the correct part of decoding
private DecodePhase phase;
private enum DecodePhase
{
ReadToken,
ReadExLiteralLength,
CopyLiteral,
ReadOffset,
ReadExMatchLength,
CopyMatch,
}
//state within interruptable phases and across phase boundaries is
//kept here - again, so that we can punt out and restart freely
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 (input == null)
throw new InvalidOperationException();
#endif
int nRead, nToRead = count;
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!
#if LOCAL_SHADOW
var phase = this.phase;
var inBufPos = this.inBufPos;
var inBufEnd = this.inBufEnd;
#endif
switch (phase)
{
case DecodePhase.ReadToken:
goto readToken;
case DecodePhase.ReadExLiteralLength:
goto readExLiteralLength;
case DecodePhase.CopyLiteral:
goto copyLiteral;
case DecodePhase.ReadOffset:
goto readOffset;
case DecodePhase.ReadExMatchLength:
goto readExMatchLength;
case DecodePhase.CopyMatch:
goto copyMatch;
}
readToken:
int tok;
if (inBufPos < inBufEnd)
{
tok = decBuf[inBufPos++];
}
else
{
#if LOCAL_SHADOW
this.inBufPos = inBufPos;
#endif
tok = ReadByteCore();
#if LOCAL_SHADOW
inBufPos = this.inBufPos;
inBufEnd = this.inBufEnd;
#endif
#if CHECK_EOF
if (tok == -1)
goto finish;
#endif
}
litLen = tok >> 4;
matLen = (tok & 0xF) + 4;
switch (litLen)
{
case 0:
phase = DecodePhase.ReadOffset;
goto readOffset;
case 0xF:
phase = DecodePhase.ReadExLiteralLength;
goto readExLiteralLength;
default:
phase = DecodePhase.CopyLiteral;
goto copyLiteral;
}
readExLiteralLength:
int exLitLen;
if (inBufPos < inBufEnd)
{
exLitLen = decBuf[inBufPos++];
}
else
{
#if LOCAL_SHADOW
this.inBufPos = inBufPos;
#endif
exLitLen = ReadByteCore();
#if LOCAL_SHADOW
inBufPos = this.inBufPos;
inBufEnd = this.inBufEnd;
#endif
#if CHECK_EOF
if (exLitLen == -1)
goto finish;
#endif
}
litLen += exLitLen;
if (exLitLen == 255)
goto readExLiteralLength;
phase = DecodePhase.CopyLiteral;
goto copyLiteral;
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++];
nRead = nReadLit;
}
else
{
#if LOCAL_SHADOW
this.inBufPos = inBufPos;
#endif
nRead = ReadCore(buffer, offset, nReadLit);
#if LOCAL_SHADOW
inBufPos = this.inBufPos;
inBufEnd = this.inBufEnd;
#endif
#if CHECK_EOF
if (nRead == 0)
goto finish;
#endif
}
offset += nRead;
nToRead -= nRead;
litLen -= nRead;
if (litLen != 0)
goto copyLiteral;
}
if (nToRead == 0)
goto finish;
phase = DecodePhase.ReadOffset;
goto readOffset;
readOffset:
if (inBufPos + 1 < inBufEnd)
{
matDst = (decBuf[inBufPos + 1] << 8) | decBuf[inBufPos];
inBufPos += 2;
}
else
{
#if LOCAL_SHADOW
this.inBufPos = inBufPos;
#endif
matDst = ReadOffsetCore();
#if LOCAL_SHADOW
inBufPos = this.inBufPos;
inBufEnd = this.inBufEnd;
#endif
#if CHECK_EOF
if (matDst == -1)
goto finish;
#endif
}
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
{
#if LOCAL_SHADOW
this.inBufPos = inBufPos;
#endif
exMatLen = ReadByteCore();
#if LOCAL_SHADOW
inBufPos = this.inBufPos;
inBufEnd = this.inBufEnd;
#endif
#if CHECK_EOF
if (exMatLen == -1)
goto finish;
#endif
}
matLen += exMatLen;
if (exMatLen == 255)
goto readExMatchLength;
phase = DecodePhase.CopyMatch;
goto copyMatch;
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 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;
}
int sOfs = offset - matDst;
for (int i = bufDst; i < nCpyMat; i++)
buffer[offset++] = buffer[sOfs++];
nToRead -= nCpyMat;
matLen -= nCpyMat;
}
if (nToRead == 0)
goto finish;
phase = DecodePhase.ReadToken;
goto readToken;
finish:
nRead = count - nToRead;
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;
while (nToBuf-- != 0)
decBuf[decPos++ & DecBufMask] = buffer[repPos++];
decodeBufferPos = decPos & DecBufMask;
}
#if LOCAL_SHADOW
this.phase = phase;
this.inBufPos = inBufPos;
#endif
return nRead;
}
private int ReadByteCore()
{
var buf = decodeBuffer;
if (inBufPos == inBufEnd)
{
int nRead = input.Read(buf, DecBufLen,
InBufLen < inputLength ? InBufLen : (int)inputLength);
#if CHECK_EOF
if (nRead == 0)
return -1;
#endif
inputLength -= nRead;
inBufPos = DecBufLen;
inBufEnd = DecBufLen + nRead;
}
return buf[inBufPos++];
}
private int ReadOffsetCore()
{
var buf = decodeBuffer;
if (inBufPos == inBufEnd)
{
int nRead = input.Read(buf, DecBufLen,
InBufLen < inputLength ? InBufLen : (int)inputLength);
#if CHECK_EOF
if (nRead == 0)
return -1;
#endif
inputLength -= nRead;
inBufPos = DecBufLen;
inBufEnd = DecBufLen + nRead;
}
if (inBufEnd - inBufPos == 1)
{
buf[DecBufLen] = buf[inBufPos];
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;
return -1;
}
#endif
inputLength -= nRead;
inBufPos = DecBufLen;
inBufEnd = DecBufLen + nRead + 1;
}
int ret = (buf[inBufPos + 1] << 8) | buf[inBufPos];
inBufPos += 2;
return ret;
}
private int ReadCore(byte[] buffer, int offset, int count)
{
int nToRead = count;
var buf = decodeBuffer;
int inBufLen = inBufEnd - inBufPos;
int fromBuf = nToRead < inBufLen ? nToRead : inBufLen;
if (fromBuf != 0)
{
var bufPos = inBufPos;
for (int c = fromBuf; c-- != 0;)
buffer[offset++] = buf[bufPos++];
inBufPos = bufPos;
nToRead -= fromBuf;
}
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);
inBufPos = DecBufLen;
inBufEnd = DecBufLen + nRead;
fromBuf = nToRead < nRead ? nToRead : nRead;
var bufPos = inBufPos;
for (int c = fromBuf; c-- != 0;)
buffer[offset++] = buf[bufPos++];
inBufPos = bufPos;
nToRead -= fromBuf;
}
inputLength -= nRead;
}
return count - nToRead;
}
#region Stream internals
public override bool CanRead => true;
public override bool CanSeek => false;
public override bool CanWrite => false;
public override void Flush()
{
}
public override long Length => 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 void SetLength(long value)
{
throw new NotSupportedException();
}
public override void Write(byte[] buffer, int offset, int count)
{
throw new NotSupportedException();
}
#endregion
}
}

View File

@@ -0,0 +1,232 @@
using System;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace UnityStudio
{
class OpenFolderDialog
{
/// <summary>
/// Gets/sets folder in which dialog will be open.
/// </summary>
public string InitialFolder { get; set; }
/// <summary>
/// Gets/sets directory in which dialog will be open if there is no recent directory available.
/// </summary>
public string DefaultFolder { get; set; }
/// <summary>
/// Gets selected folder.
/// </summary>
public string Folder { get; private set; }
internal DialogResult ShowDialog(IWin32Window owner)
{
if (Environment.OSVersion.Version.Major >= 6)
{
return ShowVistaDialog(owner);
}
else
{
return ShowLegacyDialog(owner);
}
}
private DialogResult ShowVistaDialog(IWin32Window owner)
{
var frm = (NativeMethods.IFileDialog)(new NativeMethods.FileOpenDialogRCW());
frm.GetOptions(out var options);
options |= NativeMethods.FOS_PICKFOLDERS | NativeMethods.FOS_FORCEFILESYSTEM | NativeMethods.FOS_NOVALIDATE | NativeMethods.FOS_NOTESTFILECREATE | NativeMethods.FOS_DONTADDTORECENT;
frm.SetOptions(options);
if (this.InitialFolder != null)
{
var riid = new Guid("43826D1E-E718-42EE-BC55-A1E261C37BFE"); //IShellItem
if (NativeMethods.SHCreateItemFromParsingName(this.InitialFolder, IntPtr.Zero, ref riid, out var directoryShellItem) == NativeMethods.S_OK)
{
frm.SetFolder(directoryShellItem);
}
}
if (this.DefaultFolder != null)
{
var riid = new Guid("43826D1E-E718-42EE-BC55-A1E261C37BFE"); //IShellItem
if (NativeMethods.SHCreateItemFromParsingName(this.DefaultFolder, IntPtr.Zero, ref riid, out var directoryShellItem) == NativeMethods.S_OK)
{
frm.SetDefaultFolder(directoryShellItem);
}
}
if (frm.Show(owner.Handle) == NativeMethods.S_OK)
{
if (frm.GetResult(out var shellItem) == NativeMethods.S_OK)
{
if (shellItem.GetDisplayName(NativeMethods.SIGDN_FILESYSPATH, out var pszString) == NativeMethods.S_OK)
{
if (pszString != IntPtr.Zero)
{
try
{
this.Folder = Marshal.PtrToStringAuto(pszString);
return DialogResult.OK;
}
finally
{
Marshal.FreeCoTaskMem(pszString);
}
}
}
}
}
return DialogResult.Cancel;
}
private DialogResult ShowLegacyDialog(IWin32Window owner)
{
using (var frm = new FolderBrowserDialog())
{
if (this.InitialFolder != null) { frm.SelectedPath = this.InitialFolder; }
if (frm.ShowDialog(owner) == DialogResult.OK)
{
this.Folder = Path.GetDirectoryName(frm.SelectedPath);
return DialogResult.OK;
}
else
{
return DialogResult.Cancel;
}
}
}
}
internal static class NativeMethods
{
#region Constants
public const uint FOS_PICKFOLDERS = 0x00000020;
public const uint FOS_FORCEFILESYSTEM = 0x00000040;
public const uint FOS_NOVALIDATE = 0x00000100;
public const uint FOS_NOTESTFILECREATE = 0x00010000;
public const uint FOS_DONTADDTORECENT = 0x02000000;
public const uint S_OK = 0x0000;
public const uint SIGDN_FILESYSPATH = 0x80058000;
#endregion
#region COM
[ComImport, ClassInterface(ClassInterfaceType.None), TypeLibType(TypeLibTypeFlags.FCanCreate), Guid("DC1C5A9C-E88A-4DDE-A5A1-60F82A20AEF7")]
internal class FileOpenDialogRCW { }
[ComImport(), Guid("42F85136-DB7E-439C-85F1-E4075D135FC8"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
internal interface IFileDialog
{
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
[PreserveSig()]
uint Show([In, Optional] IntPtr hwndOwner); //IModalWindow
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint SetFileTypes([In] uint cFileTypes, [In, MarshalAs(UnmanagedType.LPArray)] IntPtr rgFilterSpec);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint SetFileTypeIndex([In] uint iFileType);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint GetFileTypeIndex(out uint piFileType);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint Advise([In, MarshalAs(UnmanagedType.Interface)] IntPtr pfde, out uint pdwCookie);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint Unadvise([In] uint dwCookie);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint SetOptions([In] uint fos);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint GetOptions(out uint fos);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
void SetDefaultFolder([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint SetFolder([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint GetFolder([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint GetCurrentSelection([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint SetFileName([In, MarshalAs(UnmanagedType.LPWStr)] string pszName);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint GetFileName([MarshalAs(UnmanagedType.LPWStr)] out string pszName);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint SetTitle([In, MarshalAs(UnmanagedType.LPWStr)] string pszTitle);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint SetOkButtonLabel([In, MarshalAs(UnmanagedType.LPWStr)] string pszText);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint SetFileNameLabel([In, MarshalAs(UnmanagedType.LPWStr)] string pszLabel);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint GetResult([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint AddPlace([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi, uint fdap);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint SetDefaultExtension([In, MarshalAs(UnmanagedType.LPWStr)] string pszDefaultExtension);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint Close([MarshalAs(UnmanagedType.Error)] uint hr);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint SetClientGuid([In] ref Guid guid);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint ClearClientData();
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint SetFilter([MarshalAs(UnmanagedType.Interface)] IntPtr pFilter);
}
[ComImport, Guid("43826D1E-E718-42EE-BC55-A1E261C37BFE"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
internal interface IShellItem
{
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint BindToHandler([In] IntPtr pbc, [In] ref Guid rbhid, [In] ref Guid riid, [Out, MarshalAs(UnmanagedType.Interface)] out IntPtr ppvOut);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint GetParent([MarshalAs(UnmanagedType.Interface)] out IShellItem ppsi);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint GetDisplayName([In] uint sigdnName, out IntPtr ppszName);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint GetAttributes([In] uint sfgaoMask, out uint psfgaoAttribs);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
uint Compare([In, MarshalAs(UnmanagedType.Interface)] IShellItem psi, [In] uint hint, out int piOrder);
}
#endregion
[DllImport("shell32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
internal static extern int SHCreateItemFromParsingName([MarshalAs(UnmanagedType.LPWStr)] string pszPath, IntPtr pbc, ref Guid riid, [MarshalAs(UnmanagedType.Interface)] out IShellItem ppv);
}
}

21
UnityStudio/Program.cs Normal file
View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace UnityStudio
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new UnityStudioForm());
}
}
}

View File

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("UnityStudio")]
[assembly: AssemblyDescription("UnityStudio 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 2017.3 version.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UnityStudio")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("05c04c20-dd89-4895-9f06-33d5cfbfe925")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// 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.9.0.0")]
[assembly: AssemblyFileVersion("0.9.0.0")]

View File

@@ -0,0 +1,165 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace UnityStudio.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <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("UnityStudio.Properties.Resources", typeof(Resources).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 normal;
///
///out vec4 outputColor;
///
///void main()
///{
/// vec3 unitNormal = normalize(normal);
/// float nDotProduct = clamp(dot(unitNormal, vec3(0.707, 0, 0.707)), 0, 1);
/// vec2 ContributionWeightsSqrt = vec2(0.5, 0.5f) + vec2(0.5f, -0.5f) * unitNormal.y;
/// vec2 ContributionWeights = ContributionWeightsSqrt * ContributionWeightsSqrt;
///
/// vec3 color = nDotProduct * vec3(1, 0.957, 0.839) / 3.14159;
/// color += vec3(0.779, 0.716, 0.453) * ContributionWeights.y;
/// color += vec3(0.368, 0.477, 0. [字符串的其余部分被截断]&quot;; 的本地化字符串。
/// </summary>
internal static string fs {
get {
return ResourceManager.GetString("fs", resourceCulture);
}
}
/// <summary>
/// 查找类似 #version 140
///
///out vec4 outputColor;
///
///void main()
///{
/// outputColor = vec4(0, 0, 0, 1);
///} 的本地化字符串。
/// </summary>
internal static string fsBlack {
get {
return ResourceManager.GetString("fsBlack", resourceCulture);
}
}
/// <summary>
/// 查找类似 #version 140
///
///out vec4 outputColor;
///in vec4 color;
///
///void main()
///{
/// outputColor = color;
///} 的本地化字符串。
/// </summary>
internal static string fsColor {
get {
return ResourceManager.GetString("fsColor", resourceCulture);
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap preview {
get {
object obj = ResourceManager.GetObject("preview", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
/// </summary>
internal static System.Drawing.Icon unity {
get {
object obj = ResourceManager.GetObject("unity", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// 查找类似 #version 140
///
///in vec3 vertexPosition;
///in vec3 normalDirection;
///in vec4 vertexColor;
///uniform mat4 modelMatrix;
///uniform mat4 viewMatrix;
///
///out vec3 normal;
///out vec4 color;
///
///void main()
///{
/// gl_Position = viewMatrix * modelMatrix * vec4(vertexPosition, 1.0);
/// normal = normalDirection;
/// color = vertexColor;
///} 的本地化字符串。
/// </summary>
internal static string vs {
get {
return ResourceManager.GetString("vs", resourceCulture);
}
}
}
}

View File

@@ -0,0 +1,187 @@
<?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 normal;
out vec4 outputColor;
void main()
{
vec3 unitNormal = normalize(normal);
float nDotProduct = clamp(dot(unitNormal, vec3(0.707, 0, 0.707)), 0, 1);
vec2 ContributionWeightsSqrt = vec2(0.5, 0.5f) + vec2(0.5f, -0.5f) * unitNormal.y;
vec2 ContributionWeights = ContributionWeightsSqrt * ContributionWeightsSqrt;
vec3 color = nDotProduct * vec3(1, 0.957, 0.839) / 3.14159;
color += vec3(0.779, 0.716, 0.453) * ContributionWeights.y;
color += vec3(0.368, 0.477, 0.735) * ContributionWeights.x;
outputColor = vec4(sqrt(color), 1);
}</value>
</data>
<data name="fsBlack" xml:space="preserve">
<value>#version 140
out vec4 outputColor;
void main()
{
outputColor = vec4(0, 0, 0, 1);
}</value>
</data>
<data name="fsColor" xml:space="preserve">
<value>#version 140
out vec4 outputColor;
in vec4 color;
void main()
{
outputColor = color;
}</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="preview" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\preview.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="unity" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\unity.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="vs" xml:space="preserve">
<value>#version 140
in vec3 vertexPosition;
in vec3 normalDirection;
in vec4 vertexColor;
uniform mat4 modelMatrix;
uniform mat4 viewMatrix;
out vec3 normal;
out vec4 color;
void main()
{
gl_Position = viewMatrix * modelMatrix * vec4(vertexPosition, 1.0);
normal = normalDirection;
color = vertexColor;
}</value>
</data>
</root>

View File

@@ -0,0 +1,242 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace UnityStudio.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.6.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool displayAll {
get {
return ((bool)(this["displayAll"]));
}
set {
this["displayAll"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool enablePreview {
get {
return ((bool)(this["enablePreview"]));
}
set {
this["enablePreview"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool displayInfo {
get {
return ((bool)(this["displayInfo"]));
}
set {
this["displayInfo"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool openAfterExport {
get {
return ((bool)(this["openAfterExport"]));
}
set {
this["openAfterExport"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int assetGroupOption {
get {
return ((int)(this["assetGroupOption"]));
}
set {
this["assetGroupOption"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportNormals {
get {
return ((bool)(this["exportNormals"]));
}
set {
this["exportNormals"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool exportTangents {
get {
return ((bool)(this["exportTangents"]));
}
set {
this["exportTangents"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportUVs {
get {
return ((bool)(this["exportUVs"]));
}
set {
this["exportUVs"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportColors {
get {
return ((bool)(this["exportColors"]));
}
set {
this["exportColors"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("2.54")]
public decimal scaleFactor {
get {
return ((decimal)(this["scaleFactor"]));
}
set {
this["scaleFactor"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int upAxis {
get {
return ((int)(this["upAxis"]));
}
set {
this["upAxis"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool showExpOpt {
get {
return ((bool)(this["showExpOpt"]));
}
set {
this["showExpOpt"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool exportDeformers {
get {
return ((bool)(this["exportDeformers"]));
}
set {
this["exportDeformers"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool convertDummies {
get {
return ((bool)(this["convertDummies"]));
}
set {
this["convertDummies"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool convertTexture {
get {
return ((bool)(this["convertTexture"]));
}
set {
this["convertTexture"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool convertAudio {
get {
return ((bool)(this["convertAudio"]));
}
set {
this["convertAudio"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("PNG")]
public string convertType {
get {
return ((string)(this["convertType"]));
}
set {
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

@@ -0,0 +1,60 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Unity_Studio.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="displayAll" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="enablePreview" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="displayInfo" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="openAfterExport" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="assetGroupOption" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="exportNormals" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="exportTangents" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="exportUVs" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="exportColors" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="scaleFactor" Type="System.Decimal" Scope="User">
<Value Profile="(Default)">2.54</Value>
</Setting>
<Setting Name="upAxis" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
<Setting Name="showExpOpt" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="exportDeformers" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="convertDummies" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="convertTexture" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="convertAudio" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace UnityStudio
{
public class AssetPreloadData : ListViewItem
{
public long m_PathID;
public uint Offset;
public int Size;
public int Type1;
public int Type2;
public string TypeString;
public int fullSize;
public string InfoText;
public string extension;
public AssetsFile sourceFile;
public string uniqueID;
public EndianBinaryReader Reader
{
get
{
var reader = sourceFile.assetsFileReader;
reader.Position = Offset;
return reader;
}
}
}
}

View File

@@ -0,0 +1,483 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
namespace UnityStudio
{
public class AssetsFile
{
public EndianBinaryReader assetsFileReader;
public string filePath;
public string bundlePath;
public string fileName;
public string upperFileName;
public int fileGen;
public bool valid;
public string m_Version = "2.5.0f5";
public int[] version = { 0, 0, 0, 0 };
public string[] buildType;
public int platform = 100663296;
public string platformStr = "";
public Dictionary<long, AssetPreloadData> preloadTable = new Dictionary<long, AssetPreloadData>();
public Dictionary<long, GameObject> GameObjectList = new Dictionary<long, GameObject>();
public Dictionary<long, Transform> TransformList = new Dictionary<long, Transform>();
public List<AssetPreloadData> exportableAssets = new List<AssetPreloadData>();
public List<UnityShared> sharedAssetsList = new List<UnityShared> { new UnityShared() };
public SortedDictionary<int, ClassStruct> ClassStructures = new SortedDictionary<int, ClassStruct>();
private bool baseDefinitions;
private List<int[]> classIDs = new List<int[]>();//use for 5.5.0
public static string[] buildTypeSplit = { ".", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
#region cmmon string
private static Dictionary<int, string> baseStrings = new Dictionary<int, string>
{
{0, "AABB"},
{5, "AnimationClip"},
{19, "AnimationCurve"},
{34, "AnimationState"},
{49, "Array"},
{55, "Base"},
{60, "BitField"},
{69, "bitset"},
{76, "bool"},
{81, "char"},
{86, "ColorRGBA"},
{96, "Component"},
{106, "data"},
{111, "deque"},
{117, "double"},
{124, "dynamic_array"},
{138, "FastPropertyName"},
{155, "first"},
{161, "float"},
{167, "Font"},
{172, "GameObject"},
{183, "Generic Mono"},
{196, "GradientNEW"},
{208, "GUID"},
{213, "GUIStyle"},
{222, "int"},
{226, "list"},
{231, "long long"},
{241, "map"},
{245, "Matrix4x4f"},
{256, "MdFour"},
{263, "MonoBehaviour"},
{277, "MonoScript"},
{288, "m_ByteSize"},
{299, "m_Curve"},
{307, "m_EditorClassIdentifier"},
{331, "m_EditorHideFlags"},
{349, "m_Enabled"},
{359, "m_ExtensionPtr"},
{374, "m_GameObject"},
{387, "m_Index"},
{395, "m_IsArray"},
{405, "m_IsStatic"},
{416, "m_MetaFlag"},
{427, "m_Name"},
{434, "m_ObjectHideFlags"},
{452, "m_PrefabInternal"},
{469, "m_PrefabParentObject"},
{490, "m_Script"},
{499, "m_StaticEditorFlags"},
{519, "m_Type"},
{526, "m_Version"},
{536, "Object"},
{543, "pair"},
{548, "PPtr<Component>"},
{564, "PPtr<GameObject>"},
{581, "PPtr<Material>"},
{596, "PPtr<MonoBehaviour>"},
{616, "PPtr<MonoScript>"},
{633, "PPtr<Object>"},
{646, "PPtr<Prefab>"},
{659, "PPtr<Sprite>"},
{672, "PPtr<TextAsset>"},
{688, "PPtr<Texture>"},
{702, "PPtr<Texture2D>"},
{718, "PPtr<Transform>"},
{734, "Prefab"},
{741, "Quaternionf"},
{753, "Rectf"},
{759, "RectInt"},
{767, "RectOffset"},
{778, "second"},
{785, "set"},
{789, "short"},
{795, "size"},
{800, "SInt16"},
{807, "SInt32"},
{814, "SInt64"},
{821, "SInt8"},
{827, "staticvector"},
{840, "string"},
{847, "TextAsset"},
{857, "TextMesh"},
{866, "Texture"},
{874, "Texture2D"},
{884, "Transform"},
{894, "TypelessData"},
{907, "UInt16"},
{914, "UInt32"},
{921, "UInt64"},
{928, "UInt8"},
{934, "unsigned int"},
{947, "unsigned long long"},
{966, "unsigned short"},
{981, "vector"},
{988, "Vector2f"},
{997, "Vector3f"},
{1006, "Vector4f"},
{1015, "m_ScriptingClassIdentifier"},
{1042, "Gradient"},
{1051, "Type*"}
};
#endregion
public class UnityShared
{
public int Index = -2; //-2 - Prepare, -1 - Missing
public string aName = "";
public string fileName = "";
}
public AssetsFile(string fullName, EndianBinaryReader reader)
{
assetsFileReader = reader;
filePath = fullName;
fileName = Path.GetFileName(fullName);
upperFileName = fileName.ToUpper();
try
{
int tableSize = assetsFileReader.ReadInt32();
int dataEnd = assetsFileReader.ReadInt32();
fileGen = assetsFileReader.ReadInt32();
uint dataOffset = assetsFileReader.ReadUInt32();
sharedAssetsList[0].fileName = fileName; //reference itself because sharedFileIDs start from 1
switch (fileGen)
{
case 6: //2.5.0 - 2.6.1
{
assetsFileReader.Position = (dataEnd - tableSize);
assetsFileReader.Position += 1;
break;
}
case 7: //3.0.0 beta
{
assetsFileReader.Position = (dataEnd - tableSize);
assetsFileReader.Position += 1;
m_Version = assetsFileReader.ReadStringToNull();
break;
}
case 8: //3.0.0 - 3.4.2
{
assetsFileReader.Position = (dataEnd - tableSize);
assetsFileReader.Position += 1;
m_Version = assetsFileReader.ReadStringToNull();
platform = assetsFileReader.ReadInt32();
break;
}
case 9: //3.5.0 - 4.6.x
{
assetsFileReader.Position += 4; //azero
m_Version = assetsFileReader.ReadStringToNull();
platform = assetsFileReader.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
{
assetsFileReader.Position += 4; //azero
m_Version = assetsFileReader.ReadStringToNull();
platform = assetsFileReader.ReadInt32();
baseDefinitions = assetsFileReader.ReadBoolean();
break;
}
default:
{
//MessageBox.Show("Unsupported Unity version!" + fileGen, "UnityStudio Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
if (platform > 255 || platform < 0)
{
byte[] b32 = BitConverter.GetBytes(platform);
Array.Reverse(b32);
platform = BitConverter.ToInt32(b32, 0);
assetsFileReader.endian = EndianType.LittleEndian;
}
platformStr = Enum.TryParse(platform.ToString(), out BuildTarget buildTarget) ? buildTarget.ToString() : "Unknown Platform";
int baseCount = assetsFileReader.ReadInt32();
for (int i = 0; i < baseCount; i++)
{
if (fileGen < 14)
{
int classID = assetsFileReader.ReadInt32();
string baseType = assetsFileReader.ReadStringToNull();
string baseName = assetsFileReader.ReadStringToNull();
assetsFileReader.Position += 20;
int memberCount = assetsFileReader.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)
{
assetsFileReader.Position += 4; //azero
}
int assetCount = assetsFileReader.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)
{
assetsFileReader.AlignStream(4);
}
AssetPreloadData asset = new AssetPreloadData();
asset.m_PathID = fileGen < 14 ? assetsFileReader.ReadInt32() : assetsFileReader.ReadInt64();
asset.Offset = assetsFileReader.ReadUInt32();
asset.Offset += dataOffset;
asset.Size = assetsFileReader.ReadInt32();
if (fileGen > 15)
{
int index = assetsFileReader.ReadInt32();
asset.Type1 = classIDs[index][0];
asset.Type2 = classIDs[index][1];
}
else
{
asset.Type1 = assetsFileReader.ReadInt32();
asset.Type2 = assetsFileReader.ReadUInt16();
assetsFileReader.Position += 2;
}
if (fileGen == 15)
{
byte unknownByte = assetsFileReader.ReadByte();
//this is a single byte, not an int32
//the next entry is aligned after this
//but not the last!
}
if (ClassIDReference.Names.TryGetValue(asset.Type2, out var typeString))
{
asset.TypeString = typeString;
}
else
{
asset.TypeString = "Unknown Type " + asset.Type2;
}
asset.uniqueID = i.ToString(assetIDfmt);
asset.fullSize = asset.Size;
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 = assetsFileReader.Position;
BuildSettings BSettings = new BuildSettings(asset);
m_Version = BSettings.m_Version;
assetsFileReader.Position = nextAsset;
}
#endregion
}
#endregion
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
{
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 = assetsFileReader.ReadInt32();
for (int i = 0; i < someCount; i++)
{
int num1 = assetsFileReader.ReadInt32();
assetsFileReader.AlignStream(4);
long m_PathID = assetsFileReader.ReadInt64();
}
}
int sharedFileCount = assetsFileReader.ReadInt32();
for (int i = 0; i < sharedFileCount; i++)
{
var shared = new UnityShared();
shared.aName = assetsFileReader.ReadStringToNull();
assetsFileReader.Position += 20;
var sharedFilePath = assetsFileReader.ReadStringToNull(); //relative path
shared.fileName = Path.GetFileName(sharedFilePath);
sharedAssetsList.Add(shared);
}
valid = true;
}
catch
{
}
}
private void readBase(List<ClassMember> cb, int level)
{
string varType = assetsFileReader.ReadStringToNull();
string varName = assetsFileReader.ReadStringToNull();
int size = assetsFileReader.ReadInt32();
int index = assetsFileReader.ReadInt32();
int isArray = assetsFileReader.ReadInt32();
int num0 = assetsFileReader.ReadInt32();
int flag = assetsFileReader.ReadInt32();
int childrenCount = assetsFileReader.ReadInt32();
cb.Add(new ClassMember
{
Level = level - 1,
Type = varType,
Name = varName,
Size = size,
Flag = flag
});
for (int i = 0; i < childrenCount; i++) { readBase(cb, level + 1); }
}
private void readBase5()
{
int classID = assetsFileReader.ReadInt32();
if (fileGen > 15)//5.5.0 and up
{
assetsFileReader.ReadByte();
int type1;
if ((type1 = assetsFileReader.ReadInt16()) >= 0)
{
type1 = -1 - type1;
}
else
{
type1 = classID;
}
classIDs.Add(new[] { type1, classID });
if (classID == 114)
{
assetsFileReader.Position += 16;
}
classID = type1;
}
else if (classID < 0)
{
assetsFileReader.Position += 16;
}
assetsFileReader.Position += 16;
if (baseDefinitions)
{
int varCount = assetsFileReader.ReadInt32();
int stringSize = assetsFileReader.ReadInt32();
assetsFileReader.Position += varCount * 24;
var stringReader = new EndianBinaryReader(new MemoryStream(assetsFileReader.ReadBytes(stringSize)));
string className = "";
var classVar = new List<ClassMember>();
//build Class Structures
assetsFileReader.Position -= varCount * 24 + stringSize;
for (int i = 0; i < varCount; i++)
{
ushort num0 = assetsFileReader.ReadUInt16();
byte level = assetsFileReader.ReadByte();
bool isArray = assetsFileReader.ReadBoolean();
ushort varTypeIndex = assetsFileReader.ReadUInt16();
ushort test = assetsFileReader.ReadUInt16();
string varTypeStr;
if (test == 0) //varType is an offset in the string block
{
stringReader.Position = varTypeIndex;
varTypeStr = stringReader.ReadStringToNull();
}
else //varType is an index in an internal strig array
{
varTypeStr = baseStrings.ContainsKey(varTypeIndex) ? baseStrings[varTypeIndex] : varTypeIndex.ToString();
}
ushort varNameIndex = assetsFileReader.ReadUInt16();
test = assetsFileReader.ReadUInt16();
string varNameStr;
if (test == 0)
{
stringReader.Position = varNameIndex;
varNameStr = stringReader.ReadStringToNull();
}
else
{
varNameStr = baseStrings.ContainsKey(varNameIndex) ? baseStrings[varNameIndex] : varNameIndex.ToString();
}
int size = assetsFileReader.ReadInt32();
int index = assetsFileReader.ReadInt32();
int flag = assetsFileReader.ReadInt32();
if (index == 0) { className = varTypeStr + " " + varNameStr; }
else
{
classVar.Add(new ClassMember
{
Level = level - 1,
Type = varTypeStr,
Name = varNameStr,
Size = size,
Flag = flag
});
}
}
stringReader.Dispose();
assetsFileReader.Position += stringSize;
var aClass = new ClassStruct { ID = classID, Text = className, members = classVar };
aClass.SubItems.Add(classID.ToString());
ClassStructures[classID] = aClass;
}
}
}
}

View File

@@ -0,0 +1,217 @@
using System.Collections.Generic;
using System.IO;
using Lz4;
using SevenZip.Compression.LZMA;
namespace UnityStudio
{
public class MemoryFile
{
public string fileName;
public MemoryStream stream;
}
public class BundleFile
{
public int format;
public string versionPlayer;
public string versionEngine;
public List<MemoryFile> fileList = new List<MemoryFile>();
public BundleFile(EndianBinaryReader bundleReader)
{
var signature = bundleReader.ReadStringToNull();
switch (signature)
{
case "UnityWeb":
case "UnityRaw":
case "\xFA\xFA\xFA\xFA\xFA\xFA\xFA\xFA":
{
format = bundleReader.ReadInt32();
versionPlayer = bundleReader.ReadStringToNull();
versionEngine = bundleReader.ReadStringToNull();
if (format < 6)
{
int bundleSize = bundleReader.ReadInt32();
}
else if (format == 6)
{
ReadFormat6(bundleReader, true);
return;
}
short dummy2 = bundleReader.ReadInt16();
int offset = bundleReader.ReadInt16();
int dummy3 = bundleReader.ReadInt32();
int lzmaChunks = bundleReader.ReadInt32();
int lzmaSize = 0;
long streamSize = 0;
for (int i = 0; i < lzmaChunks; i++)
{
lzmaSize = bundleReader.ReadInt32();
streamSize = bundleReader.ReadInt32();
}
bundleReader.Position = offset;
switch (signature)
{
case "\xFA\xFA\xFA\xFA\xFA\xFA\xFA\xFA": //.bytes
case "UnityWeb":
{
var lzmaBuffer = bundleReader.ReadBytes(lzmaSize);
using (var lzmaStream = new EndianBinaryReader(SevenZipHelper.StreamDecompress(new MemoryStream(lzmaBuffer))))
{
GetAssetsFiles(lzmaStream, 0);
}
break;
}
case "UnityRaw":
{
GetAssetsFiles(bundleReader, offset);
break;
}
}
break;
}
case "UnityFS":
format = bundleReader.ReadInt32();
versionPlayer = bundleReader.ReadStringToNull();
versionEngine = bundleReader.ReadStringToNull();
if (format == 6)
{
ReadFormat6(bundleReader);
}
break;
}
}
private void GetAssetsFiles(EndianBinaryReader reader, int offset)
{
int fileCount = reader.ReadInt32();
for (int i = 0; i < fileCount; i++)
{
var file = new MemoryFile();
file.fileName = reader.ReadStringToNull();
int fileOffset = reader.ReadInt32();
fileOffset += offset;
int fileSize = reader.ReadInt32();
long nextFile = reader.Position;
reader.Position = fileOffset;
var buffer = reader.ReadBytes(fileSize);
file.stream = new MemoryStream(buffer);
fileList.Add(file);
reader.Position = nextFile;
}
}
private void ReadFormat6(EndianBinaryReader bundleReader, bool padding = false)
{
var bundleSize = bundleReader.ReadInt64();
int compressedSize = bundleReader.ReadInt32();
int uncompressedSize = bundleReader.ReadInt32();
int flag = bundleReader.ReadInt32();
if (padding)
bundleReader.ReadByte();
byte[] blocksInfoBytes;
if ((flag & 0x80) != 0)//at end of file
{
var position = bundleReader.Position;
bundleReader.Position = bundleReader.BaseStream.Length - compressedSize;
blocksInfoBytes = bundleReader.ReadBytes(compressedSize);
bundleReader.Position = position;
}
else
{
blocksInfoBytes = bundleReader.ReadBytes(compressedSize);
}
MemoryStream blocksInfoStream;
switch (flag & 0x3F)
{
default://None
{
blocksInfoStream = new MemoryStream(blocksInfoBytes);
break;
}
case 1://LZMA
{
blocksInfoStream = SevenZipHelper.StreamDecompress(new MemoryStream(blocksInfoBytes));
break;
}
case 2://LZ4
case 3://LZ4HC
{
byte[] uncompressedBytes = new byte[uncompressedSize];
using (var decoder = new Lz4DecoderStream(new MemoryStream(blocksInfoBytes)))
{
decoder.Read(uncompressedBytes, 0, uncompressedSize);
}
blocksInfoStream = new MemoryStream(uncompressedBytes);
break;
}
//case 4:LZHAM?
}
using (var blocksInfo = new EndianBinaryReader(blocksInfoStream))
{
blocksInfo.Position = 0x10;
int blockcount = blocksInfo.ReadInt32();
var assetsDataStream = new MemoryStream();
for (int i = 0; i < blockcount; i++)
{
uncompressedSize = blocksInfo.ReadInt32();
compressedSize = blocksInfo.ReadInt32();
flag = blocksInfo.ReadInt16();
var compressedBytes = bundleReader.ReadBytes(compressedSize);
switch (flag & 0x3F)
{
default://None
{
assetsDataStream.Write(compressedBytes, 0, compressedSize);
break;
}
case 1://LZMA
{
var uncompressedBytes = new byte[uncompressedSize];
using (var mstream = new MemoryStream(compressedBytes))
{
var decoder = SevenZipHelper.StreamDecompress(mstream, uncompressedSize);
decoder.Read(uncompressedBytes, 0, uncompressedSize);
decoder.Dispose();
}
assetsDataStream.Write(uncompressedBytes, 0, uncompressedSize);
break;
}
case 2://LZ4
case 3://LZ4HC
{
var uncompressedBytes = new byte[uncompressedSize];
using (var decoder = new Lz4DecoderStream(new MemoryStream(compressedBytes)))
{
decoder.Read(uncompressedBytes, 0, uncompressedSize);
}
assetsDataStream.Write(uncompressedBytes, 0, uncompressedSize);
break;
}
//case 4:LZHAM?
}
}
using (var assetsDataReader = new EndianBinaryReader(assetsDataStream))
{
var entryinfo_count = blocksInfo.ReadInt32();
for (int i = 0; i < entryinfo_count; i++)
{
var file = new MemoryFile();
var entryinfo_offset = blocksInfo.ReadInt64();
var entryinfo_size = blocksInfo.ReadInt64();
flag = blocksInfo.ReadInt32();
file.fileName = Path.GetFileName(blocksInfo.ReadStringToNull());
assetsDataReader.Position = entryinfo_offset;
var buffer = assetsDataReader.ReadBytes((int)entryinfo_size);
file.stream = new MemoryStream(buffer);
fileList.Add(file);
}
}
}
}
}
}

View File

@@ -0,0 +1,277 @@
using System.Collections.Generic;
namespace UnityStudio
{
public static class ClassIDReference
{
public static Dictionary<int, string> Names = new Dictionary<int, string>()
{
{1, "GameObject"},
{2, "Component"},
{3, "LevelGameManager"},
{4, "Transform"},
{5, "TimeManager"},
{6, "GlobalGameManager"},
{8, "Behaviour"},
{9, "GameManager"},
{11, "AudioManager"},
{12, "ParticleAnimator"},
{13, "InputManager"},
{15, "EllipsoidParticleEmitter"},
{17, "Pipeline"},
{18, "EditorExtension"},
{19, "Physics2DSettings"},
{20, "Camera"},
{21, "Material"},
{23, "MeshRenderer"},
{25, "Renderer"},
{26, "ParticleRenderer"},
{27, "Texture"},
{28, "Texture2D"},
{29, "SceneSettings"},
{30, "GraphicsSettings"},
{33, "MeshFilter"},
{41, "OcclusionPortal"},
{43, "Mesh"},
{45, "Skybox"},
{47, "QualitySettings"},
{48, "Shader"},
{49, "TextAsset"},
{50, "Rigidbody2D"},
{51, "Physics2DManager"},
{53, "Collider2D"},
{54, "Rigidbody"},
{55, "PhysicsManager"},
{56, "Collider"},
{57, "Joint"},
{58, "CircleCollider2D"},
{59, "HingeJoint"},
{60, "PolygonCollider2D"},
{61, "BoxCollider2D"},
{62, "PhysicsMaterial2D"},
{64, "MeshCollider"},
{65, "BoxCollider"},
{66, "SpriteCollider2D"},
{68, "EdgeCollider2D"},
{70, "CapsuleCollider2D"},
{72, "ComputeShader"},
{74, "AnimationClip"},
{75, "ConstantForce"},
{76, "WorldParticleCollider"},
{78, "TagManager"},
{81, "AudioListener"},
{82, "AudioSource"},
{83, "AudioClip"},
{84, "RenderTexture"},
{86, "CustomRenderTexture"},
{87, "MeshParticleEmitter"},
{88, "ParticleEmitter"},
{89, "Cubemap"},
{90, "Avatar"},
{91, "AnimatorController"},
{92, "GUILayer"},
{93, "RuntimeAnimatorController"},
{94, "ScriptMapper"},
{95, "Animator"},
{96, "TrailRenderer"},
{98, "DelayedCallManager"},
{102, "TextMesh"},
{104, "RenderSettings"},
{108, "Light"},
{109, "CGProgram"},
{110, "BaseAnimationTrack"},
{111, "Animation"},
{114, "MonoBehaviour"},
{115, "MonoScript"},
{116, "MonoManager"},
{117, "Texture3D"},
{118, "NewAnimationTrack"},
{119, "Projector"},
{120, "LineRenderer"},
{121, "Flare"},
{122, "Halo"},
{123, "LensFlare"},
{124, "FlareLayer"},
{125, "HaloLayer"},
{126, "NavMeshAreas"},
{127, "HaloManager"},
{128, "Font"},
{129, "PlayerSettings"},
{130, "NamedObject"},
{131, "GUITexture"},
{132, "GUIText"},
{133, "GUIElement"},
{134, "PhysicMaterial"},
{135, "SphereCollider"},
{136, "CapsuleCollider"},
{137, "SkinnedMeshRenderer"},
{138, "FixedJoint"},
{140, "RaycastCollider"},
{141, "BuildSettings"},
{142, "AssetBundle"},
{143, "CharacterController"},
{144, "CharacterJoint"},
{145, "SpringJoint"},
{146, "WheelCollider"},
{147, "ResourceManager"},
{148, "NetworkView"},
{149, "NetworkManager"},
{150, "PreloadData"},
{152, "MovieTexture"},
{153, "ConfigurableJoint"},
{154, "TerrainCollider"},
{155, "MasterServerInterface"},
{156, "TerrainData"},
{157, "LightmapSettings"},
{158, "WebCamTexture"},
{159, "EditorSettings"},
{160, "InteractiveCloth"},
{161, "ClothRenderer"},
{162, "EditorUserSettings"},
{163, "SkinnedCloth"},
{164, "AudioReverbFilter"},
{165, "AudioHighPassFilter"},
{166, "AudioChorusFilter"},
{167, "AudioReverbZone"},
{168, "AudioEchoFilter"},
{169, "AudioLowPassFilter"},
{170, "AudioDistortionFilter"},
{171, "SparseTexture"},
{180, "AudioBehaviour"},
{181, "AudioFilter"},
{182, "WindZone"},
{183, "Cloth"},
{184, "SubstanceArchive"},
{185, "ProceduralMaterial"},
{186, "ProceduralTexture"},
{187, "Texture2DArray"},
{188, "CubemapArray"},
{191, "OffMeshLink"},
{192, "OcclusionArea"},
{193, "Tree"},
{194, "NavMeshObsolete"},
{195, "NavMeshAgent"},
{196, "NavMeshSettings"},
{197, "LightProbesLegacy"},
{198, "ParticleSystem"},
{199, "ParticleSystemRenderer"},
{200, "ShaderVariantCollection"},
{205, "LODGroup"},
{206, "BlendTree"},
{207, "Motion"},
{208, "NavMeshObstacle"},
{210, "TerrainInstance"},
{212, "SpriteRenderer"},
{213, "Sprite"},
{214, "CachedSpriteAtlas"},
{215, "ReflectionProbe"},
{216, "ReflectionProbes"},
{218, "Terrain"},
{220, "LightProbeGroup"},
{221, "AnimatorOverrideController"},
{222, "CanvasRenderer"},
{223, "Canvas"},
{224, "RectTransform"},
{225, "CanvasGroup"},
{226, "BillboardAsset"},
{227, "BillboardRenderer"},
{228, "SpeedTreeWindAsset"},
{229, "AnchoredJoint2D"},
{230, "Joint2D"},
{231, "SpringJoint2D"},
{232, "DistanceJoint2D"},
{233, "HingeJoint2D"},
{234, "SliderJoint2D"},
{235, "WheelJoint2D"},
{236, "ClusterInputManager"},
{237, "BaseVideoTexture"},
{238, "NavMeshData"},
{240, "AudioMixer"},
{241, "AudioMixerController"},
{243, "AudioMixerGroupController"},
{244, "AudioMixerEffectController"},
{245, "AudioMixerSnapshotController"},
{246, "PhysicsUpdateBehaviour2D"},
{247, "ConstantForce2D"},
{248, "Effector2D"},
{249, "AreaEffector2D"},
{250, "PointEffector2D"},
{251, "PlatformEffector2D"},
{252, "SurfaceEffector2D"},
{253, "BuoyancyEffector2D"},
{254, "RelativeJoint2D"},
{255, "FixedJoint2D"},
{256, "FrictionJoint2D"},
{257, "TargetJoint2D"},
{258, "LightProbes"},
{259, "LightProbeProxyVolume"},
{271, "SampleClip"},
{272, "AudioMixerSnapshot"},
{273, "AudioMixerGroup"},
{280, "NScreenBridge"},
{290, "AssetBundleManifest"},
{292, "UnityAdsManager"},
{300, "RuntimeInitializeOnLoadManager"},
{301, "CloudWebServicesManager"},
{303, "UnityAnalyticsManager"},
{304, "CrashReportManager"},
{305, "PerformanceReportingManager"},
{310, "UnityConnectSettings"},
{319, "AvatarMask"},
{328, "VideoPlayer"},
{329, "VideoClip"},
{363, "OcclusionCullingData"},
{1001, "Prefab"},
{1002, "EditorExtensionImpl"},
{1003, "AssetImporter"},
{1004, "AssetDatabase"},
{1005, "Mesh3DSImporter"},
{1006, "TextureImporter"},
{1007, "ShaderImporter"},
{1008, "ComputeShaderImporter"},
{1011, "AvatarMask"},
{1020, "AudioImporter"},
{1026, "HierarchyState"},
{1027, "GUIDSerializer"},
{1028, "AssetMetaData"},
{1029, "DefaultAsset"},
{1030, "DefaultImporter"},
{1031, "TextScriptImporter"},
{1032, "SceneAsset"},
{1034, "NativeFormatImporter"},
{1035, "MonoImporter"},
{1037, "AssetServerCache"},
{1038, "LibraryAssetImporter"},
{1040, "ModelImporter"},
{1041, "FBXImporter"},
{1042, "TrueTypeFontImporter"},
{1044, "MovieImporter"},
{1045, "EditorBuildSettings"},
{1046, "DDSImporter"},
{1048, "InspectorExpandedState"},
{1049, "AnnotationManager"},
{1050, "PluginImporter"},
{1051, "EditorUserBuildSettings"},
{1052, "PVRImporter"},
{1053, "ASTCImporter"},
{1054, "KTXImporter"},
{1101, "AnimatorStateTransition"},
{1102, "AnimatorState"},
{1105, "HumanTemplate"},
{1107, "AnimatorStateMachine"},
{1108, "PreviewAssetType"},
{1109, "AnimatorTransition"},
{1110, "SpeedTreeImporter"},
{1111, "AnimatorTransitionBase"},
{1112, "SubstanceImporter"},
{1113, "LightmapParameters"},
{1120, "LightmapSnapshot"},
{367388927, "SubDerived"},
{334799969, "SiblingDerived"},
{687078895, "SpriteAtlas"},
{1091556383, "Derived"},
{1480428607, "LowerResBlitTexture"},
{1571458007, "RenderPassAttachment"}
};
}
}

View File

@@ -0,0 +1,189 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace UnityStudio
{
public class ClassMember
{
public int Level;
public string Type;
public string Name;
public int Size;
public int Flag;
//use for read
public bool alignBefore;
}
public class ClassStruct : ListViewItem
{
public int ID;
public List<ClassMember> members;
public string membersstr
{
get
{
var sb = new StringBuilder();
foreach (var i in members)
{
sb.AppendFormat("{0}{1} {2} {3} {4}\r\n", new string('\t', i.Level), i.Type, i.Name, i.Size, (i.Flag & 0x4000) != 0);
}
return sb.ToString();
}
}
}
public static class ClassStructHelper
{
public static string ViewStruct(this AssetPreloadData asset)
{
var reader = asset.Reader;
if (asset.sourceFile.ClassStructures.TryGetValue(asset.Type1, out var classStructure))
{
var sb = new StringBuilder();
ReadClassStruct(sb, classStructure.members, reader);
return sb.ToString();
}
return null;
}
public static void ReadClassStruct(StringBuilder sb, List<ClassMember> members, EndianBinaryReader reader)
{
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 (member.alignBefore)
reader.AlignStream(4);
switch (varTypeStr)
{
case "SInt8":
value = reader.ReadSByte();
break;
case "UInt8":
value = reader.ReadByte();
break;
case "short":
case "SInt16":
value = reader.ReadInt16();
break;
case "UInt16":
case "unsigned short":
value = reader.ReadUInt16();
break;
case "int":
case "SInt32":
value = reader.ReadInt32();
break;
case "UInt32":
case "unsigned int":
case "Type*":
value = reader.ReadUInt32();
break;
case "long long":
case "SInt64":
value = reader.ReadInt64();
break;
case "UInt64":
case "unsigned long long":
value = reader.ReadUInt64();
break;
case "float":
value = reader.ReadSingle();
break;
case "double":
value = reader.ReadDouble();
break;
case "bool":
value = reader.ReadBoolean();
break;
case "string":
append = false;
var str = reader.ReadAlignedString(reader.ReadInt32());
sb.AppendFormat("{0}{1} {2} = \"{3}\"\r\n", (new string('\t', level)), varTypeStr, varNameStr, str);
i += 3;//skip
break;
case "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 = reader.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);
ReadClassStruct(sb, array, reader);
}
i += array.Count + 1;//skip
break;
}
case "TypelessData":
{
append = false;
var size = reader.ReadInt32();
reader.ReadBytes(size);
i += 2;
sb.AppendFormat("{0}{1} {2}\r\n", (new string('\t', level)), varTypeStr, varNameStr);
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), "int", "size", size);
break;
}
default:
append = false;
if (align)
{
align = false;
SetAlignBefore(members, level, i + 1);
}
sb.AppendFormat("{0}{1} {2}\r\n", (new string('\t', level)), varTypeStr, varNameStr);
break;
}
if (append)
sb.AppendFormat("{0}{1} {2} = {3}\r\n", (new string('\t', level)), varTypeStr, varNameStr, value);
if (align)
reader.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;
}
public static void SetAlignBefore(List<ClassMember> members, int level, int index)
{
for (int i = index; i < members.Count; i++)
{
var member = members[i];
var level2 = member.Level;
if (level2 <= level)
{
member.alignBefore = true;
return;
}
}
}
}
}

View File

@@ -0,0 +1,152 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace UnityStudio
{
public enum EndianType
{
BigEndian,
LittleEndian
}
public class EndianBinaryReader : BinaryReader
{
public EndianType endian;
private byte[] a16 = new byte[2];
private byte[] a32 = new byte[4];
private byte[] a64 = new byte[8];
public EndianBinaryReader(Stream stream, EndianType endian = EndianType.BigEndian)
: base(stream)
{ this.endian = endian; }
public long Position
{
get => BaseStream.Position;
set => BaseStream.Position = value;
}
public override short ReadInt16()
{
if (endian == EndianType.BigEndian)
{
a16 = ReadBytes(2);
Array.Reverse(a16);
return BitConverter.ToInt16(a16, 0);
}
return base.ReadInt16();
}
public override int ReadInt32()
{
if (endian == EndianType.BigEndian)
{
a32 = ReadBytes(4);
Array.Reverse(a32);
return BitConverter.ToInt32(a32, 0);
}
return base.ReadInt32();
}
public override long ReadInt64()
{
if (endian == EndianType.BigEndian)
{
a64 = ReadBytes(8);
Array.Reverse(a64);
return BitConverter.ToInt64(a64, 0);
}
return base.ReadInt64();
}
public override ushort ReadUInt16()
{
if (endian == EndianType.BigEndian)
{
a16 = ReadBytes(2);
Array.Reverse(a16);
return BitConverter.ToUInt16(a16, 0);
}
return base.ReadUInt16();
}
public override uint ReadUInt32()
{
if (endian == EndianType.BigEndian)
{
a32 = ReadBytes(4);
Array.Reverse(a32);
return BitConverter.ToUInt32(a32, 0);
}
return base.ReadUInt32();
}
public override ulong ReadUInt64()
{
if (endian == EndianType.BigEndian)
{
a64 = ReadBytes(8);
Array.Reverse(a64);
return BitConverter.ToUInt64(a64, 0);
}
return base.ReadUInt64();
}
public override float ReadSingle()
{
if (endian == EndianType.BigEndian)
{
a32 = ReadBytes(4);
Array.Reverse(a32);
return BitConverter.ToSingle(a32, 0);
}
return base.ReadSingle();
}
public override double ReadDouble()
{
if (endian == EndianType.BigEndian)
{
a64 = ReadBytes(8);
Array.Reverse(a64);
return BitConverter.ToUInt64(a64, 0);
}
return base.ReadDouble();
}
public string ReadASCII(int length)
{
return Encoding.ASCII.GetString(ReadBytes(length));
}
public void AlignStream(int alignment)
{
var pos = BaseStream.Position;
var mod = pos % alignment;
if (mod != 0) { BaseStream.Position += alignment - mod; }
}
public string ReadAlignedString(int length)
{
if (length > 0 && length < (BaseStream.Length - BaseStream.Position))
{
var stringData = ReadBytes(length);
var result = Encoding.UTF8.GetString(stringData);
AlignStream(4);
return result;
}
return "";
}
public string ReadStringToNull()
{
var bytes = new List<byte>();
byte b;
while (BaseStream.Position != BaseStream.Length && (b = ReadByte()) != 0)
bytes.Add(b);
return Encoding.UTF8.GetString(bytes.ToArray());
}
}
}

View File

@@ -0,0 +1,135 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace UnityStudio
{
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,
}
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
}
public enum BuildTarget
{
StandaloneOSX = 2,
StandaloneOSXIntel = 4,
StandaloneWindows,
WebPlayer,
WebPlayerStreamed,
iOS = 9,
PS3,
XBOX360,
Android = 13,
StandaloneLinux = 17,
StandaloneWindows64 = 19,
WebGL,
WSAPlayer,
StandaloneLinux64 = 24,
StandaloneLinuxUniversal,
WP8Player,
StandaloneOSXIntel64,
BlackBerry,
Tizen,
PSP2,
PS4,
PSM,
XboxOne,
SamsungTV,
N3DS,
WiiU,
tvOS,
Switch,
iPhone = -1,
BB10 = -1,
MetroPlayer = -1,
NoTarget = -2
}
}

View File

@@ -0,0 +1,320 @@
using System;
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using static UnityStudio.SpriteHelper;
namespace UnityStudio
{
static class Exporter
{
public static bool ExportTexture2D(AssetPreloadData asset, string exportPathName, bool flip)
{
var m_Texture2D = new Texture2D(asset, true);
if (m_Texture2D.image_data == null)
return false;
var convert = (bool)Properties.Settings.Default["convertTexture"];
var bitmap = m_Texture2D.ConvertToBitmap(flip);
if (convert && bitmap != null)
{
ImageFormat format = null;
var ext = (string)Properties.Settings.Default["convertType"];
switch (ext)
{
case "BMP":
format = ImageFormat.Bmp;
break;
case "PNG":
format = ImageFormat.Png;
break;
case "JPEG":
format = ImageFormat.Jpeg;
break;
}
var exportFullName = exportPathName + asset.Text + "." + ext.ToLower();
if (ExportFileExists(exportFullName))
return false;
bitmap.Save(exportFullName, format);
bitmap.Dispose();
return true;
}
if (!convert)
{
var exportFullName = exportPathName + asset.Text + asset.extension;
if (ExportFileExists(exportFullName))
return false;
File.WriteAllBytes(exportFullName, m_Texture2D.ConvertToContainer());
return true;
}
return false;
}
public static bool ExportAudioClip(AssetPreloadData asset, string exportPath)
{
var m_AudioClip = new AudioClip(asset, true);
if (m_AudioClip.m_AudioData == null)
return false;
var convertAudio = (bool)Properties.Settings.Default["convertAudio"];
if (convertAudio && m_AudioClip.IsFMODSupport)
{
var exportFullName = exportPath + asset.Text + ".wav";
if (ExportFileExists(exportFullName))
return false;
FMOD.CREATESOUNDEXINFO exinfo = new FMOD.CREATESOUNDEXINFO();
var result = FMOD.Factory.System_Create(out var system);
if (result != FMOD.RESULT.OK)
return false;
result = system.init(1, FMOD.INITFLAGS.NORMAL, IntPtr.Zero);
if (result != FMOD.RESULT.OK)
return false;
exinfo.cbsize = Marshal.SizeOf(exinfo);
exinfo.length = (uint)m_AudioClip.m_Size;
result = system.createSound(m_AudioClip.m_AudioData, FMOD.MODE.OPENMEMORY, ref exinfo, out var sound);
if (result != FMOD.RESULT.OK)
return false;
result = sound.getSubSound(0, out var subsound);
if (result != FMOD.RESULT.OK)
return false;
result = subsound.getFormat(out var type, out var format, out int NumChannels, out int BitsPerSample);
if (result != FMOD.RESULT.OK)
return false;
result = subsound.getDefaults(out var frequency, out int priority);
if (result != FMOD.RESULT.OK)
return false;
var SampleRate = (int)frequency;
result = subsound.getLength(out var length, FMOD.TIMEUNIT.PCMBYTES);
if (result != FMOD.RESULT.OK)
return false;
result = subsound.@lock(0, length, out var ptr1, out var ptr2, out var len1, out var len2);
if (result != FMOD.RESULT.OK)
return false;
byte[] buffer = new byte[len1 + 44];
//添加wav头
Encoding.UTF8.GetBytes("RIFF").CopyTo(buffer, 0);
BitConverter.GetBytes(len1 + 36).CopyTo(buffer, 4);
Encoding.UTF8.GetBytes("WAVEfmt ").CopyTo(buffer, 8);
BitConverter.GetBytes(16).CopyTo(buffer, 16);
BitConverter.GetBytes((short)1).CopyTo(buffer, 20);
BitConverter.GetBytes((short)NumChannels).CopyTo(buffer, 22);
BitConverter.GetBytes(SampleRate).CopyTo(buffer, 24);
BitConverter.GetBytes(SampleRate * NumChannels * BitsPerSample / 8).CopyTo(buffer, 28);
BitConverter.GetBytes((short)(NumChannels * BitsPerSample / 8)).CopyTo(buffer, 32);
BitConverter.GetBytes((short)BitsPerSample).CopyTo(buffer, 34);
Encoding.UTF8.GetBytes("data").CopyTo(buffer, 36);
BitConverter.GetBytes(len1).CopyTo(buffer, 40);
Marshal.Copy(ptr1, buffer, 44, (int)len1);
File.WriteAllBytes(exportFullName, buffer);
result = subsound.unlock(ptr1, ptr2, len1, len2);
if (result != FMOD.RESULT.OK)
return false;
subsound.release();
sound.release();
system.release();
}
else
{
var exportFullName = exportPath + asset.Text + asset.extension;
if (ExportFileExists(exportFullName))
return false;
File.WriteAllBytes(exportFullName, m_AudioClip.m_AudioData);
}
return true;
}
public static bool ExportShader(AssetPreloadData asset, string exportPath)
{
var m_Shader = new Shader(asset, true);
var exportFullName = exportPath + asset.Text + asset.extension;
if (ExportFileExists(exportFullName))
return false;
File.WriteAllBytes(exportFullName, m_Shader.m_Script);
return true;
}
public static bool ExportTextAsset(AssetPreloadData asset, string exportPath)
{
var m_TextAsset = new TextAsset(asset, true);
var exportFullName = exportPath + asset.Text + asset.extension;
if (ExportFileExists(exportFullName))
return false;
File.WriteAllBytes(exportFullName, m_TextAsset.m_Script);
return true;
}
public static bool ExportMonoBehaviour(AssetPreloadData asset, string exportPath)
{
var m_MonoBehaviour = new MonoBehaviour(asset, true);
var exportFullName = exportPath + asset.Text + asset.extension;
if (ExportFileExists(exportFullName))
return false;
File.WriteAllText(exportFullName, m_MonoBehaviour.serializedText);
return true;
}
public static bool ExportFont(AssetPreloadData asset, string exportPath)
{
var m_Font = new UnityFont(asset, true);
if (m_Font.m_FontData != null)
{
var exportFullName = exportPath + asset.Text + asset.extension;
if (ExportFileExists(exportFullName))
return false;
File.WriteAllBytes(exportFullName, m_Font.m_FontData);
return true;
}
return false;
}
public static bool ExportMesh(AssetPreloadData asset, string exportPath)
{
var m_Mesh = new Mesh(asset, true);
if (m_Mesh.m_VertexCount <= 0)
return false;
var exportFullName = exportPath + asset.Text + asset.extension;
if (ExportFileExists(exportFullName))
return false;
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
int sum = 0;
for (var i = 0; i < m_Mesh.m_SubMeshes.Count; i++)
{
sb.AppendLine($"g {m_Mesh.m_Name}_{i}");
int indexCount = (int)m_Mesh.m_SubMeshes[i].indexCount;
var end = sum + indexCount / 3;
for (int f = sum; f < end; 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);
}
sum = end;
}
#endregion
sb.Replace("NaN", "0");
File.WriteAllText(exportFullName, sb.ToString());
return true;
}
public static bool ExportVideoClip(AssetPreloadData asset, string exportPath)
{
var m_VideoClip = new VideoClip(asset, true);
if (m_VideoClip.m_VideoData != null)
{
var exportFullName = exportPath + asset.Text + asset.extension;
if (ExportFileExists(exportFullName))
return false;
File.WriteAllBytes(exportFullName, m_VideoClip.m_VideoData);
return true;
}
return false;
}
public static bool ExportMovieTexture(AssetPreloadData asset, string exportPath)
{
var m_MovieTexture = new MovieTexture(asset, true);
var exportFullName = exportPath + asset.Text + asset.extension;
if (ExportFileExists(exportFullName))
return false;
File.WriteAllBytes(exportFullName, m_MovieTexture.m_MovieData);
return true;
}
public static bool ExportSprite(AssetPreloadData asset, string exportPath)
{
ImageFormat format = null;
var type = (string)Properties.Settings.Default["convertType"];
switch (type)
{
case "BMP":
format = ImageFormat.Bmp;
break;
case "PNG":
format = ImageFormat.Png;
break;
case "JPEG":
format = ImageFormat.Jpeg;
break;
}
var exportFullName = exportPath + asset.Text + "." + type.ToLower();
if (ExportFileExists(exportFullName))
return false;
var bitmap = GetImageFromSprite(asset);
if (bitmap != null)
{
bitmap.Save(exportFullName, format);
return true;
}
return false;
}
public static bool ExportRawFile(AssetPreloadData asset, string exportPath)
{
var exportFullName = exportPath + asset.Text + asset.extension;
if (ExportFileExists(exportFullName))
return false;
var bytes = asset.Reader.ReadBytes(asset.Size);
File.WriteAllBytes(exportFullName, bytes);
return true;
}
private static bool ExportFileExists(string filename)
{
if (File.Exists(filename))
{
return true;
}
Directory.CreateDirectory(Path.GetDirectoryName(filename));
return false;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,180 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using static UnityStudio.Studio;
namespace UnityStudio
{
static class Importer
{
public static List<string> unityFiles = new List<string>(); //files to load
public static HashSet<string> unityFilesHash = new HashSet<string>(); //to improve the loading speed
public static HashSet<string> assetsfileListHash = new HashSet<string>(); //to improve the loading speed
public static void LoadFile(string fullName)
{
switch (CheckFileType(fullName, out var reader))
{
case FileType.AssetsFile:
LoadAssetsFile(fullName, reader);
break;
case FileType.BundleFile:
LoadBundleFile(fullName, reader);
break;
case FileType.WebFile:
LoadWebFile(fullName, reader);
break;
}
}
private static void LoadAssetsFile(string fullName, EndianBinaryReader reader)
{
var fileName = Path.GetFileName(fullName);
StatusStripUpdate("Loading " + fileName);
if (!assetsfileListHash.Contains(fileName.ToUpper()))
{
var assetsFile = new AssetsFile(fullName, reader);
if (assetsFile.valid)
{
assetsfileList.Add(assetsFile);
assetsfileListHash.Add(assetsFile.upperFileName);
#region for 2.6.x find mainData and get string version
if (assetsFile.fileGen == 6 && fileName != "mainData")
{
var mainDataFile = assetsfileList.Find(aFile => aFile.fileName == "mainData");
if (mainDataFile != null)
{
assetsFile.m_Version = mainDataFile.m_Version;
assetsFile.version = mainDataFile.version;
assetsFile.buildType = mainDataFile.buildType;
}
else if (File.Exists(Path.GetDirectoryName(fullName) + "\\mainData"))
{
mainDataFile = new AssetsFile(Path.GetDirectoryName(fullName) + "\\mainData", new EndianBinaryReader(File.OpenRead(Path.GetDirectoryName(fullName) + "\\mainData")));
assetsFile.m_Version = mainDataFile.m_Version;
assetsFile.version = mainDataFile.version;
assetsFile.buildType = mainDataFile.buildType;
}
}
#endregion
int value = 0;
foreach (var sharedFile in assetsFile.sharedAssetsList)
{
var sharedFilePath = Path.GetDirectoryName(fullName) + "\\" + sharedFile.fileName;
var sharedFileName = sharedFile.fileName;
if (!unityFilesHash.Contains(sharedFileName.ToUpper()))
{
if (!File.Exists(sharedFilePath))
{
var findFiles = Directory.GetFiles(Path.GetDirectoryName(fullName), sharedFileName, SearchOption.AllDirectories);
if (findFiles.Length > 0)
{
sharedFilePath = findFiles[0];
}
}
if (File.Exists(sharedFilePath))
{
unityFiles.Add(sharedFilePath);
unityFilesHash.Add(sharedFileName.ToUpper());
value++;
}
}
}
if (value > 0)
ProgressBarMaximumAdd(value);
}
}
}
private static void LoadBundleFile(string fullName, EndianBinaryReader reader)
{
var fileName = Path.GetFileName(fullName);
StatusStripUpdate("Decompressing " + fileName);
var bundleFile = new BundleFile(reader);
foreach (var file in bundleFile.fileList)
{
if (!assetsfileListHash.Contains(file.fileName.ToUpper()))
{
StatusStripUpdate("Loading " + file.fileName);
var assetsFile = new AssetsFile(Path.GetDirectoryName(fullName) + "\\" + file.fileName, new EndianBinaryReader(file.stream));
if (assetsFile.valid)
{
assetsFile.bundlePath = fullName;
if (assetsFile.fileGen == 6) //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 = bundleFile.versionEngine;
assetsFile.version = Array.ConvertAll((from Match m in Regex.Matches(assetsFile.m_Version, @"[0-9]") select m.Value).ToArray(), int.Parse);
assetsFile.buildType = bundleFile.versionEngine.Split(AssetsFile.buildTypeSplit, StringSplitOptions.RemoveEmptyEntries);
}
assetsfileList.Add(assetsFile);
assetsfileListHash.Add(assetsFile.upperFileName);
}
else
{
resourceFileReaders.Add(assetsFile.upperFileName, assetsFile.assetsFileReader);
}
}
}
reader.Dispose();
}
private static void LoadWebFile(string fullName, EndianBinaryReader reader)
{
var fileName = Path.GetFileName(fullName);
StatusStripUpdate("Loading " + fileName);
var bundleFile = new WebFile(reader);
reader.Dispose();
foreach (var file in bundleFile.fileList)
{
var dummyName = Path.GetDirectoryName(fullName) + "\\" + file.fileName;
switch (CheckFileType(file.stream, out reader))
{
case FileType.AssetsFile:
LoadAssetsFile(dummyName, reader);
break;
case FileType.BundleFile:
LoadBundleFile(dummyName, reader);
break;
case FileType.WebFile:
LoadWebFile(dummyName, reader);
break;
}
resourceFileReaders.Add(file.fileName.ToUpper(), reader);
}
}
public static void MergeSplitAssets(string dirPath)
{
string[] splitFiles = Directory.GetFiles(dirPath, "*.split0");
foreach (var splitFile in splitFiles)
{
string destFile = Path.GetFileNameWithoutExtension(splitFile);
string destPath = Path.GetDirectoryName(splitFile) + "\\";
var destFull = destPath + destFile;
if (!File.Exists(destFull))
{
string[] splitParts = Directory.GetFiles(destPath, destFile + ".split*");
using (var destStream = File.Create(destFull))
{
for (int i = 0; i < splitParts.Length; i++)
{
string splitPart = destFull + ".split" + i;
using (var sourceStream = File.OpenRead(splitPart))
sourceStream.CopyTo(destStream);
}
}
}
}
}
}
}

View File

@@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static UnityStudio.Studio;
namespace UnityStudio
{
public class PPtr
{
//m_FileID 0 means current file
public int m_FileID;
//m_PathID acts more like a hash in some games
public long m_PathID;
}
public static class PPtrHelpers
{
public static PPtr ReadPPtr(this AssetsFile sourceFile)
{
var result = new PPtr();
var reader = sourceFile.assetsFileReader;
int FileID = reader.ReadInt32();
if (FileID >= 0 && FileID < sourceFile.sharedAssetsList.Count)
{
var sharedFile = sourceFile.sharedAssetsList[FileID];
var index = sharedFile.Index;
if (index == -2)
{
var name = sharedFile.fileName.ToUpper();
if (!sharedFileIndex.TryGetValue(name, out index))
{
index = assetsfileList.FindIndex(aFile => aFile.upperFileName == name);
sharedFileIndex.Add(name, index);
}
sharedFile.Index = index;
}
result.m_FileID = index;
}
result.m_PathID = sourceFile.fileGen < 14 ? reader.ReadInt32() : reader.ReadInt64();
return result;
}
public static bool TryGetPD(this List<AssetsFile> assetsfileList, PPtr m_elm, out AssetPreloadData result)
{
result = null;
if (m_elm != null && m_elm.m_FileID >= 0 && m_elm.m_FileID < assetsfileList.Count)
{
AssetsFile sourceFile = assetsfileList[m_elm.m_FileID];
//TryGetValue should be safe because m_PathID is 0 when initialized and PathID values range from 1
if (sourceFile.preloadTable.TryGetValue(m_elm.m_PathID, out result)) { return true; }
}
return false;
}
public static bool TryGetTransform(this List<AssetsFile> assetsfileList, PPtr m_elm, out Transform m_Transform)
{
m_Transform = null;
if (m_elm != null && m_elm.m_FileID >= 0 && m_elm.m_FileID < assetsfileList.Count)
{
AssetsFile sourceFile = assetsfileList[m_elm.m_FileID];
if (sourceFile.TransformList.TryGetValue(m_elm.m_PathID, out m_Transform)) { return true; }
}
return false;
}
public static bool TryGetGameObject(this List<AssetsFile> assetsfileList, PPtr m_elm, out GameObject m_GameObject)
{
m_GameObject = null;
if (m_elm != null && m_elm.m_FileID >= 0 && m_elm.m_FileID < assetsfileList.Count)
{
AssetsFile sourceFile = assetsfileList[m_elm.m_FileID];
if (sourceFile.GameObjectList.TryGetValue(m_elm.m_PathID, out m_GameObject)) { return true; }
}
return false;
}
}
}

View File

@@ -0,0 +1,108 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace UnityStudio {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.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("UnityStudio.StudioClasses.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 Shader20172 {
get {
return ResourceManager.GetString("Shader20172", 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 Shader20173 {
get {
return ResourceManager.GetString("Shader20173", 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,102 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
using static UnityStudio.Studio;
namespace UnityStudio
{
static class SpriteHelper
{
private static Dictionary<AssetPreloadData, Bitmap> spriteCache = new Dictionary<AssetPreloadData, Bitmap>();
public static Bitmap GetImageFromSprite(AssetPreloadData asset)
{
if (spriteCache.TryGetValue(asset, out var bitmap))
return (Bitmap)bitmap.Clone();
var m_Sprite = new Sprite(asset, true);
if (assetsfileList.TryGetPD(m_Sprite.m_SpriteAtlas, out var assetPreloadData))
{
var m_SpriteAtlas = new SpriteAtlas(assetPreloadData);
var index = m_SpriteAtlas.guids.FindIndex(x => x == m_Sprite.first);
if (index >= 0 && assetsfileList.TryGetPD(m_SpriteAtlas.textures[index], out assetPreloadData))
{
return CutImage(asset, assetPreloadData, m_SpriteAtlas.textureRects[index], m_Sprite);
}
}
else
{
if (assetsfileList.TryGetPD(m_Sprite.texture, out assetPreloadData))
{
return CutImage(asset, assetPreloadData, m_Sprite.textureRect);
}
}
return null;
}
private static Bitmap CutImage(AssetPreloadData asset, AssetPreloadData texture2DAsset, RectangleF textureRect)
{
var texture2D = new Texture2D(texture2DAsset, true);
using (var originalImage = texture2D.ConvertToBitmap(false))
{
if (originalImage != null)
{
var info = texture2DAsset.InfoText;
var start = info.IndexOf("Format");
info = info.Substring(start, info.Length - start);
asset.InfoText = $"Width: {textureRect.Width}\nHeight: {textureRect.Height}\n" + info;
var spriteImage = originalImage.Clone(textureRect, PixelFormat.Format32bppArgb);
spriteImage.RotateFlip(RotateFlipType.RotateNoneFlipY);
spriteCache.Add(asset, spriteImage);
return (Bitmap)spriteImage.Clone();
}
}
return null;
}
private static Bitmap CutImage(AssetPreloadData asset, AssetPreloadData texture2DAsset, RectangleF textureRect, Sprite sprite)
{
var texture2D = new Texture2D(texture2DAsset, true);
using (var originalImage = texture2D.ConvertToBitmap(false))
{
if (originalImage != null)
{
var info = texture2DAsset.InfoText;
var start = info.IndexOf("Format");
info = info.Substring(start, info.Length - start);
asset.InfoText = $"Width: {textureRect.Width}\nHeight: {textureRect.Height}\n" + info;
var spriteImage = originalImage.Clone(textureRect, PixelFormat.Format32bppArgb);
using (var brush = new TextureBrush(spriteImage))
{
using (var path = new GraphicsPath())
{
foreach (var p in sprite.m_PhysicsShape)
path.AddPolygon(p);
using (var matr = new Matrix())
{
matr.Translate(sprite.m_Rect.Width * sprite.m_Pivot.X, sprite.m_Rect.Height * sprite.m_Pivot.Y);
matr.Scale(sprite.m_PixelsToUnits, sprite.m_PixelsToUnits);
path.Transform(matr);
var bitmap = new Bitmap((int)textureRect.Width, (int)textureRect.Height);
using (var graphic = Graphics.FromImage(bitmap))
{
graphic.FillPath(brush, path);
bitmap.RotateFlip(RotateFlipType.RotateNoneFlipY);
spriteCache.Add(asset, bitmap);
return (Bitmap)bitmap.Clone();
}
}
}
}
}
}
return null;
}
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace UnityStudio
{
public static class StringExtensions
{
/// <summary>
/// Compares the string against a given pattern.
/// </summary>
/// <param name="str">The string.</param>
/// <param name="pattern">The pattern to match, where "*" means any sequence of characters, and "?" means any single character.</param>
/// <returns><c>true</c> if the string matches the given pattern; otherwise <c>false</c>.</returns>
public static bool Like(this string str, string pattern)
{
return new Regex(
"^" + Regex.Escape(pattern).Replace(@"\*", ".*").Replace(@"\?", ".") + "$",
RegexOptions.IgnoreCase | RegexOptions.Singleline
).IsMatch(str);
}
}
}

View File

@@ -0,0 +1,426 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web.Script.Serialization;
namespace UnityStudio
{
internal static class Studio
{
public static List<AssetsFile> assetsfileList = new List<AssetsFile>(); //loaded files
public static Dictionary<string, int> sharedFileIndex = new Dictionary<string, int>(); //to improve the loading speed
public static Dictionary<string, EndianBinaryReader> resourceFileReaders = new Dictionary<string, EndianBinaryReader>(); //use for read res files
public static List<AssetPreloadData> exportableAssets = new List<AssetPreloadData>(); //used to hold all assets while the ListView is filtered
private static HashSet<string> exportableAssetsHash = new HashSet<string>(); //avoid the same name asset
public static List<AssetPreloadData> visibleAssets = new List<AssetPreloadData>(); //used to build the ListView from all or filtered assets
public static string productName = "";
public static string mainPath = "";
public static List<GameObject> fileNodes = new List<GameObject>();
public static Dictionary<string, Dictionary<string, string>> jsonMats;
public static Dictionary<string, SortedDictionary<int, ClassStruct>> AllClassStructures = new Dictionary<string, SortedDictionary<int, ClassStruct>>();
//UI
public static Action<int> SetProgressBarValue;
public static Action<int> SetProgressBarMaximum;
public static Action ProgressBarPerformStep;
public static Action<string> StatusStripUpdate;
public static Action<int> ProgressBarMaximumAdd;
public enum FileType
{
AssetsFile,
BundleFile,
WebFile
}
public static int ExtractBundleFile(string bundleFileName)
{
int extractedCount = 0;
if (CheckFileType(bundleFileName, out var reader) == FileType.BundleFile)
{
StatusStripUpdate($"Decompressing {Path.GetFileName(bundleFileName)} ...");
var extractPath = bundleFileName + "_unpacked\\";
Directory.CreateDirectory(extractPath);
var bundleFile = new BundleFile(reader);
foreach (var memFile in bundleFile.fileList)
{
var filePath = extractPath + memFile.fileName.Replace('/', '\\');
if (!Directory.Exists(Path.GetDirectoryName(filePath)))
{
Directory.CreateDirectory(Path.GetDirectoryName(filePath));
}
if (!File.Exists(filePath))
{
StatusStripUpdate($"Extracting {Path.GetFileName(memFile.fileName)}");
extractedCount += 1;
using (var file = File.Create(filePath))
{
memFile.stream.WriteTo(file);
memFile.stream.Close();
}
}
}
}
reader.Dispose();
return extractedCount;
}
public static void BuildAssetStructures(bool loadAssetsMenuItem, bool displayAll, bool buildHierarchyMenuItem, bool buildClassStructuresMenuItem, bool displayOriginalName)
{
#region first loop - read asset data & create list
if (loadAssetsMenuItem)
{
SetProgressBarValue(0);
SetProgressBarMaximum(assetsfileList.Sum(x => x.preloadTable.Values.Count));
string fileIDfmt = "D" + assetsfileList.Count.ToString().Length;
for (var i = 0; i < assetsfileList.Count; i++)
{
var assetsFile = assetsfileList[i];
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;
var exportable = false;
switch (asset.Type2)
{
case 1: //GameObject
{
GameObject m_GameObject = new GameObject(asset);
assetsFile.GameObjectList.Add(asset.m_PathID, m_GameObject);
//totalTreeNodes++;
break;
}
case 4: //Transform
{
Transform m_Transform = new Transform(asset);
assetsFile.TransformList.Add(asset.m_PathID, m_Transform);
break;
}
case 224: //RectTransform
{
RectTransform m_Rect = new RectTransform(asset);
assetsFile.TransformList.Add(asset.m_PathID, m_Rect.m_Transform);
break;
}
case 28: //Texture2D
{
Texture2D m_Texture2D = new Texture2D(asset, false);
exportable = true;
break;
}
case 48: //Shader
{
Shader m_Shader = new Shader(asset, false);
exportable = true;
break;
}
case 49: //TextAsset
{
TextAsset m_TextAsset = new TextAsset(asset, false);
exportable = true;
break;
}
case 83: //AudioClip
{
AudioClip m_AudioClip = new AudioClip(asset, false);
exportable = true;
break;
}
case 114: //MonoBehaviour
{
var m_MonoBehaviour = new MonoBehaviour(asset, false);
if (asset.Type1 != asset.Type2 && assetsFile.ClassStructures.ContainsKey(asset.Type1))
exportable = true;
break;
}
case 128: //Font
{
UnityFont m_Font = new UnityFont(asset, false);
exportable = true;
break;
}
case 129: //PlayerSettings
{
var plSet = new PlayerSettings(asset);
productName = plSet.productName;
break;
}
case 43: //Mesh
{
Mesh m_Mesh = new Mesh(asset, false);
exportable = true;
break;
}
case 142: //AssetBundle
{
ab = new AssetBundle(asset);
break;
}
case 329: //VideoClip
{
var m_VideoClip = new VideoClip(asset, false);
exportable = true;
break;
}
case 152: //MovieTexture
{
var m_MovieTexture = new MovieTexture(asset, false);
exportable = true;
break;
}
case 213: //Sprite
{
var m_Sprite = new Sprite(asset, false);
exportable = true;
break;
}
/*case 21: //Material
case 74: //AnimationClip
case 90: //Avatar
case 91: //AnimatorController
case 115: //MonoScript
case 687078895: //SpriteAtlas
{
if (asset.Offset + 4 > asset.sourceFile.a_Stream.BaseStream.Length)
break;
asset.sourceFile.a_Stream.Position = asset.Offset;
var len = asset.sourceFile.a_Stream.ReadInt32();
if (len > 0 && len < asset.Size - 4)
{
var bytes = asset.sourceFile.a_Stream.ReadBytes(len);
asset.Text = Encoding.UTF8.GetString(bytes);
}
break;
}*/
}
if (!exportable && displayAll)
{
asset.extension = ".dat";
exportable = true;
}
if (exportable)
{
if (asset.Text == "")
{
asset.Text = asset.TypeString + " #" + asset.uniqueID;
}
asset.SubItems.AddRange(new[] { asset.TypeString, asset.fullSize.ToString() });
//处理同名文件
if (!exportableAssetsHash.Add((asset.TypeString + asset.Text).ToUpper()))
{
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);
}
visibleAssets = exportableAssets;
exportableAssetsHash.Clear();
}
#endregion
#region second loop - build tree structure
fileNodes = new List<GameObject>();
if (buildHierarchyMenuItem)
{
SetProgressBarMaximum(1);
SetProgressBarValue(1);
SetProgressBarMaximum(assetsfileList.Sum(x => x.GameObjectList.Values.Count) + 1);
foreach (var assetsFile in assetsfileList)
{
StatusStripUpdate("Building tree structure from " + Path.GetFileName(assetsFile.filePath));
GameObject fileNode = new GameObject(null);
fileNode.Text = Path.GetFileName(assetsFile.filePath);
fileNode.m_Name = "RootNode";
foreach (var m_GameObject in assetsFile.GameObjectList.Values)
{
//ParseGameObject
foreach (var m_Component in m_GameObject.m_Components)
{
if (m_Component.m_FileID >= 0 && m_Component.m_FileID < assetsfileList.Count)
{
var sourceFile = assetsfileList[m_Component.m_FileID];
if (sourceFile.preloadTable.TryGetValue(m_Component.m_PathID, out var asset))
{
switch (asset.Type2)
{
case 4: //Transform
{
m_GameObject.m_Transform = m_Component;
break;
}
case 23: //MeshRenderer
{
m_GameObject.m_MeshRenderer = m_Component;
break;
}
case 33: //MeshFilter
{
m_GameObject.m_MeshFilter = m_Component;
break;
}
case 137: //SkinnedMeshRenderer
{
m_GameObject.m_SkinnedMeshRenderer = m_Component;
break;
}
}
}
}
}
//
var parentNode = fileNode;
if (assetsfileList.TryGetTransform(m_GameObject.m_Transform, out var m_Transform))
{
if (assetsfileList.TryGetTransform(m_Transform.m_Father, out var m_Father))
{
//GameObject Parent;
if (assetsfileList.TryGetGameObject(m_Father.m_GameObject, out parentNode))
{
//parentNode = Parent;
}
}
}
parentNode.Nodes.Add(m_GameObject);
ProgressBarPerformStep();
}
if (fileNode.Nodes.Count == 0)
{
fileNode.Text += " (no children)";
}
fileNodes.Add(fileNode);
}
if (File.Exists(mainPath + "\\materials.json"))
{
string matLine;
using (StreamReader reader = File.OpenText(mainPath + "\\materials.json"))
{ matLine = reader.ReadToEnd(); }
jsonMats = new JavaScriptSerializer().Deserialize<Dictionary<string, Dictionary<string, string>>>(matLine);
//var jsonMats = new JavaScriptSerializer().DeserializeObject(matLine);
}
}
#endregion
#region build list of class strucutres
if (buildClassStructuresMenuItem)
{
//group class structures by versionv
foreach (var assetsFile in assetsfileList)
{
if (AllClassStructures.TryGetValue(assetsFile.m_Version, out var curVer))
{
foreach (var uClass in assetsFile.ClassStructures)
{
curVer[uClass.Key] = uClass.Value;
}
}
else
{
AllClassStructures.Add(assetsFile.m_Version, assetsFile.ClassStructures);
}
}
}
#endregion
}
public static string FixFileName(string str)
{
if (str.Length >= 260) return Path.GetRandomFileName();
return Path.GetInvalidFileNameChars().Aggregate(str, (current, c) => current.Replace(c, '_'));
}
public static FileType CheckFileType(MemoryStream stream, out EndianBinaryReader reader)
{
reader = new EndianBinaryReader(stream);
return CheckFileType(reader);
}
public static FileType CheckFileType(string fileName, out EndianBinaryReader reader)
{
reader = new EndianBinaryReader(File.OpenRead(fileName));
return CheckFileType(reader);
}
public static FileType CheckFileType(EndianBinaryReader reader)
{
var signature = reader.ReadStringToNull();
reader.Position = 0;
switch (signature)
{
case "UnityWeb":
case "UnityRaw":
case "\xFA\xFA\xFA\xFA\xFA\xFA\xFA\xFA":
case "UnityFS":
return FileType.BundleFile;
case "UnityWebData1.0":
return FileType.WebFile;
default:
{
var magic = reader.ReadBytes(2);
reader.Position = 0;
if (WebFile.gzipMagic.SequenceEqual(magic))
{
return FileType.WebFile;
}
reader.Position = 0x20;
magic = reader.ReadBytes(6);
reader.Position = 0;
if (WebFile.brotliMagic.SequenceEqual(magic))
{
return FileType.WebFile;
}
return FileType.AssetsFile;
}
}
}
public static string[] ProcessingSplitFiles(List<string> selectFile)
{
var splitFiles = selectFile.Where(x => x.Contains(".split"))
.Select(x => Path.GetDirectoryName(x) + "\\" + Path.GetFileNameWithoutExtension(x))
.Distinct()
.ToList();
selectFile.RemoveAll(x => x.Contains(".split"));
foreach (var file in splitFiles)
{
if (File.Exists(file))
{
selectFile.Add(file);
}
}
return selectFile.Distinct().ToArray();
}
}
}

View File

@@ -0,0 +1,540 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace UnityStudio
{
partial class Texture2D
{
[DllImport("PVRTexLibWrapper.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern bool DecompressPVR(byte[] buffer, IntPtr bmp, int len);
[DllImport("TextureConverterWrapper.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern bool Ponvert(byte[] buffer, IntPtr bmp, int nWidth, int nHeight, int len, int type, int bmpsize, bool fixAlpha);
[DllImport("crunch.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern bool DecompressCRN(byte[] pSrc_file_data, int src_file_size, out IntPtr uncompressedData, out int uncompressedSize);
[DllImport("crunchunity.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern bool DecompressUnityCRN(byte[] pSrc_file_data, int src_file_size, out IntPtr uncompressedData, out int uncompressedSize);
[DllImport("texgenpack.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern void texgenpackdecode(int texturetype, byte[] texturedata, int width, int height, IntPtr bmp, bool fixAlpha);
public byte[] ConvertToContainer()
{
if (image_data == null || image_data.Length == 0)
return null;
switch (m_TextureFormat)
{
case TextureFormat.Alpha8:
case TextureFormat.ARGB4444:
case TextureFormat.RGB24:
case TextureFormat.RGBA32:
case TextureFormat.ARGB32:
case TextureFormat.RGB565:
case TextureFormat.R16:
case TextureFormat.DXT1:
case TextureFormat.DXT5:
case TextureFormat.RGBA4444:
case TextureFormat.BGRA32:
case TextureFormat.RG16:
case TextureFormat.R8:
return ConvertToDDS();
case TextureFormat.YUY2:
case TextureFormat.PVRTC_RGB2:
case TextureFormat.PVRTC_RGBA2:
case TextureFormat.PVRTC_RGB4:
case TextureFormat.PVRTC_RGBA4:
case TextureFormat.ETC_RGB4:
case TextureFormat.ETC2_RGB:
case TextureFormat.ETC2_RGBA1:
case TextureFormat.ETC2_RGBA8:
case TextureFormat.ASTC_RGB_4x4:
case TextureFormat.ASTC_RGB_5x5:
case TextureFormat.ASTC_RGB_6x6:
case TextureFormat.ASTC_RGB_8x8:
case TextureFormat.ASTC_RGB_10x10:
case TextureFormat.ASTC_RGB_12x12:
case TextureFormat.ASTC_RGBA_4x4:
case TextureFormat.ASTC_RGBA_5x5:
case TextureFormat.ASTC_RGBA_6x6:
case TextureFormat.ASTC_RGBA_8x8:
case TextureFormat.ASTC_RGBA_10x10:
case TextureFormat.ASTC_RGBA_12x12:
case TextureFormat.ETC_RGB4_3DS:
case TextureFormat.ETC_RGBA8_3DS:
return ConvertToPVR();
case TextureFormat.RHalf:
case TextureFormat.RGHalf:
case TextureFormat.RGBAHalf:
case TextureFormat.RFloat:
case TextureFormat.RGFloat:
case TextureFormat.RGBAFloat:
case TextureFormat.BC4:
case TextureFormat.BC5:
case TextureFormat.BC6H:
case TextureFormat.BC7:
case TextureFormat.ATC_RGB4:
case TextureFormat.ATC_RGBA8:
case TextureFormat.EAC_R:
case TextureFormat.EAC_R_SIGNED:
case TextureFormat.EAC_RG:
case TextureFormat.EAC_RG_SIGNED:
return ConvertToKTX();
default:
return image_data;
}
}
private byte[] ConvertToDDS()
{
var imageBuffer = new byte[128 + image_data_size];
dwMagic.CopyTo(imageBuffer, 0);
BitConverter.GetBytes(dwFlags).CopyTo(imageBuffer, 8);
BitConverter.GetBytes(m_Height).CopyTo(imageBuffer, 12);
BitConverter.GetBytes(m_Width).CopyTo(imageBuffer, 16);
BitConverter.GetBytes(dwPitchOrLinearSize).CopyTo(imageBuffer, 20);
BitConverter.GetBytes(dwMipMapCount).CopyTo(imageBuffer, 28);
BitConverter.GetBytes(dwSize).CopyTo(imageBuffer, 76);
BitConverter.GetBytes(dwFlags2).CopyTo(imageBuffer, 80);
BitConverter.GetBytes(dwFourCC).CopyTo(imageBuffer, 84);
BitConverter.GetBytes(dwRGBBitCount).CopyTo(imageBuffer, 88);
BitConverter.GetBytes(dwRBitMask).CopyTo(imageBuffer, 92);
BitConverter.GetBytes(dwGBitMask).CopyTo(imageBuffer, 96);
BitConverter.GetBytes(dwBBitMask).CopyTo(imageBuffer, 100);
BitConverter.GetBytes(dwABitMask).CopyTo(imageBuffer, 104);
BitConverter.GetBytes(dwCaps).CopyTo(imageBuffer, 108);
BitConverter.GetBytes(dwCaps2).CopyTo(imageBuffer, 112);
image_data.CopyTo(imageBuffer, 128);
return imageBuffer;
}
private byte[] ConvertToPVR()
{
var mstream = new MemoryStream();
using (var writer = new BinaryWriter(mstream))
{
writer.Write(pvrVersion);
writer.Write(pvrFlags);
writer.Write(pvrPixelFormat);
writer.Write(pvrColourSpace);
writer.Write(pvrChannelType);
writer.Write(m_Height);
writer.Write(m_Width);
writer.Write(pvrDepth);
writer.Write(pvrNumSurfaces);
writer.Write(pvrNumFaces);
writer.Write(dwMipMapCount);
writer.Write(pvrMetaDataSize);
writer.Write(image_data);
return mstream.ToArray();
}
}
private byte[] ConvertToKTX()
{
var mstream = new MemoryStream();
using (var writer = new BinaryWriter(mstream))
{
writer.Write(KTXHeader.IDENTIFIER);
writer.Write(KTXHeader.ENDIANESS_LE);
writer.Write(glType);
writer.Write(glTypeSize);
writer.Write(glFormat);
writer.Write(glInternalFormat);
writer.Write(glBaseInternalFormat);
writer.Write(m_Width);
writer.Write(m_Height);
writer.Write(pixelDepth);
writer.Write(numberOfArrayElements);
writer.Write(numberOfFaces);
writer.Write(numberOfMipmapLevels);
writer.Write(bytesOfKeyValueData);
writer.Write(image_data_size);
writer.Write(image_data);
return mstream.ToArray();
}
}
public Bitmap ConvertToBitmap(bool flip)
{
if (image_data == null || image_data.Length == 0)
return null;
Bitmap bitmap;
switch (m_TextureFormat)
{
case TextureFormat.Alpha8:
case TextureFormat.ARGB4444:
case TextureFormat.RGB24:
case TextureFormat.RGBA32:
case TextureFormat.ARGB32:
case TextureFormat.R16:
case TextureFormat.RGBA4444:
case TextureFormat.BGRA32:
case TextureFormat.RG16:
case TextureFormat.R8:
bitmap = BGRA32ToBitmap();
break;
case TextureFormat.RGB565:
bitmap = RGB565ToBitmap();
break;
case TextureFormat.YUY2:
case TextureFormat.PVRTC_RGB2:
case TextureFormat.PVRTC_RGBA2:
case TextureFormat.PVRTC_RGB4:
case TextureFormat.PVRTC_RGBA4:
case TextureFormat.ETC_RGB4:
case TextureFormat.ETC2_RGB:
case TextureFormat.ETC2_RGBA1:
case TextureFormat.ETC2_RGBA8:
case TextureFormat.ASTC_RGB_4x4:
case TextureFormat.ASTC_RGB_5x5:
case TextureFormat.ASTC_RGB_6x6:
case TextureFormat.ASTC_RGB_8x8:
case TextureFormat.ASTC_RGB_10x10:
case TextureFormat.ASTC_RGB_12x12:
case TextureFormat.ASTC_RGBA_4x4:
case TextureFormat.ASTC_RGBA_5x5:
case TextureFormat.ASTC_RGBA_6x6:
case TextureFormat.ASTC_RGBA_8x8:
case TextureFormat.ASTC_RGBA_10x10:
case TextureFormat.ASTC_RGBA_12x12:
case TextureFormat.ETC_RGB4_3DS:
case TextureFormat.ETC_RGBA8_3DS:
bitmap = PVRToBitmap(ConvertToPVR());
break;
case TextureFormat.DXT1:
case TextureFormat.DXT5:
case TextureFormat.RHalf:
case TextureFormat.RGHalf:
case TextureFormat.RGBAHalf:
case TextureFormat.RFloat:
case TextureFormat.RGFloat:
case TextureFormat.RGBAFloat:
case TextureFormat.RGB9e5Float:
case TextureFormat.ATC_RGB4:
case TextureFormat.ATC_RGBA8:
case TextureFormat.EAC_R:
case TextureFormat.EAC_R_SIGNED:
case TextureFormat.EAC_RG:
case TextureFormat.EAC_RG_SIGNED:
bitmap = TextureConverter();
break;
case TextureFormat.BC4:
case TextureFormat.BC5:
case TextureFormat.BC6H:
case TextureFormat.BC7:
bitmap = Texgenpack();
break;
case TextureFormat.DXT1Crunched:
case TextureFormat.DXT5Crunched:
DecompressCRN();
bitmap = TextureConverter();
break;
case TextureFormat.ETC_RGB4Crunched:
case TextureFormat.ETC2_RGBA8Crunched:
DecompressCRN();
bitmap = PVRToBitmap(ConvertToPVR());
break;
default:
return null;
}
if (bitmap != null && flip)
bitmap.RotateFlip(RotateFlipType.RotateNoneFlipY);
return bitmap;
}
private Bitmap BGRA32ToBitmap()
{
var hObject = GCHandle.Alloc(image_data, GCHandleType.Pinned);
var pObject = hObject.AddrOfPinnedObject();
var bitmap = new Bitmap(m_Width, m_Height, m_Width * 4, PixelFormat.Format32bppArgb, pObject);
hObject.Free();
return bitmap;
}
private Bitmap RGB565ToBitmap()
{
//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, stride, PixelFormat.Format16bppRgb565, pObject);
hObject.Free();
return bitmap;
}
private Bitmap PVRToBitmap(byte[] pvrdata)
{
var bitmap = new Bitmap(m_Width, m_Height);
var rect = new Rectangle(0, 0, m_Width, m_Height);
var bmd = bitmap.LockBits(rect, ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
var len = Math.Abs(bmd.Stride) * bmd.Height;
if (!DecompressPVR(pvrdata, bmd.Scan0, len))
{
bitmap.UnlockBits(bmd);
bitmap.Dispose();
return null;
}
bitmap.UnlockBits(bmd);
return bitmap;
}
private Bitmap TextureConverter()
{
var bitmap = new Bitmap(m_Width, m_Height);
var rect = new Rectangle(0, 0, m_Width, m_Height);
var bmd = bitmap.LockBits(rect, ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
var len = Math.Abs(bmd.Stride) * bmd.Height;
var fixAlpha = glBaseInternalFormat == KTXHeader.GL_RED || glBaseInternalFormat == KTXHeader.GL_RG;
if (!Ponvert(image_data, bmd.Scan0, m_Width, m_Height, image_data_size, (int)q_format, len, fixAlpha))
{
bitmap.UnlockBits(bmd);
bitmap.Dispose();
return null;
}
bitmap.UnlockBits(bmd);
return bitmap;
}
private void DecompressCRN()
{
IntPtr uncompressedData;
int uncompressedSize;
bool result;
if (version[0] > 2017 || (version[0] == 2017 && version[1] >= 3)) //2017.3 and up
{
result = DecompressUnityCRN(image_data, image_data_size, out uncompressedData, out uncompressedSize);
}
else
{
result = DecompressCRN(image_data, image_data_size, out uncompressedData, out uncompressedSize);
}
if (result)
{
var uncompressedBytes = new byte[uncompressedSize];
Marshal.Copy(uncompressedData, uncompressedBytes, 0, uncompressedSize);
Marshal.FreeHGlobal(uncompressedData);
image_data = uncompressedBytes;
image_data_size = uncompressedSize;
}
}
private Bitmap Texgenpack()
{
var bitmap = new Bitmap(m_Width, m_Height);
var rect = new Rectangle(0, 0, m_Width, m_Height);
var bmd = bitmap.LockBits(rect, ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
var fixAlpha = glBaseInternalFormat == KTXHeader.GL_RED || glBaseInternalFormat == KTXHeader.GL_RG;
texgenpackdecode((int)texturetype, image_data, m_Width, m_Height, bmd.Scan0, fixAlpha);
bitmap.UnlockBits(bmd);
return bitmap;
}
}
public static class KTXHeader
{
public static byte[] IDENTIFIER = { 0xAB, 0x4B, 0x54, 0x58, 0x20, 0x31, 0x31, 0xBB, 0x0D, 0x0A, 0x1A, 0x0A };
public static byte[] ENDIANESS_LE = { 1, 2, 3, 4 };
public static byte[] ENDIANESS_BE = { 4, 3, 2, 1 };
// constants for glInternalFormat
public static int GL_ETC1_RGB8_OES = 0x8D64;
public static int GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
public static int GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01;
public static int GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;
public static int GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;
public static int GL_ATC_RGB_AMD = 0x8C92;
public static int GL_ATC_RGBA_EXPLICIT_ALPHA_AMD = 0x8C93;
public static int GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD = 0x87EE;
public static int GL_COMPRESSED_RGB8_ETC2 = 0x9274;
public static int GL_COMPRESSED_SRGB8_ETC2 = 0x9275;
public static int GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276;
public static int GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277;
public static int GL_COMPRESSED_RGBA8_ETC2_EAC = 0x9278;
public static int GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279;
public static int GL_COMPRESSED_R11_EAC = 0x9270;
public static int GL_COMPRESSED_SIGNED_R11_EAC = 0x9271;
public static int GL_COMPRESSED_RG11_EAC = 0x9272;
public static int GL_COMPRESSED_SIGNED_RG11_EAC = 0x9273;
public static int GL_COMPRESSED_RED_RGTC1 = 0x8DBB;
public static int GL_COMPRESSED_RG_RGTC2 = 0x8DBD;
public static int GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F;
public static int GL_COMPRESSED_RGBA_BPTC_UNORM = 0x8E8C;
public static int GL_R16F = 0x822D;
public static int GL_RG16F = 0x822F;
public static int GL_RGBA16F = 0x881A;
public static int GL_R32F = 0x822E;
public static int GL_RG32F = 0x8230;
public static int GL_RGBA32F = 0x8814;
// constants for glBaseInternalFormat
public static int GL_RED = 0x1903;
public static int GL_GREEN = 0x1904;
public static int GL_BLUE = 0x1905;
public static int GL_ALPHA = 0x1906;
public static int GL_RGB = 0x1907;
public static int GL_RGBA = 0x1908;
public static int GL_RG = 0x8227;
}
//from TextureConverter.h
public enum QFORMAT
{
// General formats
Q_FORMAT_RGBA_8UI = 1,
Q_FORMAT_RGBA_8I,
Q_FORMAT_RGB5_A1UI,
Q_FORMAT_RGBA_4444,
Q_FORMAT_RGBA_16UI,
Q_FORMAT_RGBA_16I,
Q_FORMAT_RGBA_32UI,
Q_FORMAT_RGBA_32I,
Q_FORMAT_PALETTE_8_RGBA_8888,
Q_FORMAT_PALETTE_8_RGBA_5551,
Q_FORMAT_PALETTE_8_RGBA_4444,
Q_FORMAT_PALETTE_4_RGBA_8888,
Q_FORMAT_PALETTE_4_RGBA_5551,
Q_FORMAT_PALETTE_4_RGBA_4444,
Q_FORMAT_PALETTE_1_RGBA_8888,
Q_FORMAT_PALETTE_8_RGB_888,
Q_FORMAT_PALETTE_8_RGB_565,
Q_FORMAT_PALETTE_4_RGB_888,
Q_FORMAT_PALETTE_4_RGB_565,
Q_FORMAT_R2_GBA10UI,
Q_FORMAT_RGB10_A2UI,
Q_FORMAT_RGB10_A2I,
Q_FORMAT_RGBA_F,
Q_FORMAT_RGBA_HF,
Q_FORMAT_RGB9_E5, // Last five bits are exponent bits (Read following section in GLES3 spec: "3.8.17 Shared Exponent Texture Color Conversion")
Q_FORMAT_RGB_8UI,
Q_FORMAT_RGB_8I,
Q_FORMAT_RGB_565,
Q_FORMAT_RGB_16UI,
Q_FORMAT_RGB_16I,
Q_FORMAT_RGB_32UI,
Q_FORMAT_RGB_32I,
Q_FORMAT_RGB_F,
Q_FORMAT_RGB_HF,
Q_FORMAT_RGB_11_11_10_F,
Q_FORMAT_RG_F,
Q_FORMAT_RG_HF,
Q_FORMAT_RG_32UI,
Q_FORMAT_RG_32I,
Q_FORMAT_RG_16I,
Q_FORMAT_RG_16UI,
Q_FORMAT_RG_8I,
Q_FORMAT_RG_8UI,
Q_FORMAT_RG_S88,
Q_FORMAT_R_32UI,
Q_FORMAT_R_32I,
Q_FORMAT_R_F,
Q_FORMAT_R_16F,
Q_FORMAT_R_16I,
Q_FORMAT_R_16UI,
Q_FORMAT_R_8I,
Q_FORMAT_R_8UI,
Q_FORMAT_LUMINANCE_ALPHA_88,
Q_FORMAT_LUMINANCE_8,
Q_FORMAT_ALPHA_8,
Q_FORMAT_LUMINANCE_ALPHA_F,
Q_FORMAT_LUMINANCE_F,
Q_FORMAT_ALPHA_F,
Q_FORMAT_LUMINANCE_ALPHA_HF,
Q_FORMAT_LUMINANCE_HF,
Q_FORMAT_ALPHA_HF,
Q_FORMAT_DEPTH_16,
Q_FORMAT_DEPTH_24,
Q_FORMAT_DEPTH_24_STENCIL_8,
Q_FORMAT_DEPTH_32,
Q_FORMAT_BGR_565,
Q_FORMAT_BGRA_8888,
Q_FORMAT_BGRA_5551,
Q_FORMAT_BGRX_8888,
Q_FORMAT_BGRA_4444,
// Compressed formats
Q_FORMAT_ATITC_RGBA,
Q_FORMAT_ATC_RGBA_EXPLICIT_ALPHA = Q_FORMAT_ATITC_RGBA,
Q_FORMAT_ATITC_RGB,
Q_FORMAT_ATC_RGB = Q_FORMAT_ATITC_RGB,
Q_FORMAT_ATC_RGBA_INTERPOLATED_ALPHA,
Q_FORMAT_ETC1_RGB8,
Q_FORMAT_3DC_X,
Q_FORMAT_3DC_XY,
Q_FORMAT_ETC2_RGB8,
Q_FORMAT_ETC2_RGBA8,
Q_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1,
Q_FORMAT_ETC2_SRGB8,
Q_FORMAT_ETC2_SRGB8_ALPHA8,
Q_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1,
Q_FORMAT_EAC_R_SIGNED,
Q_FORMAT_EAC_R_UNSIGNED,
Q_FORMAT_EAC_RG_SIGNED,
Q_FORMAT_EAC_RG_UNSIGNED,
Q_FORMAT_S3TC_DXT1_RGB,
Q_FORMAT_S3TC_DXT1_RGBA,
Q_FORMAT_S3TC_DXT3_RGBA,
Q_FORMAT_S3TC_DXT5_RGBA,
// YUV formats
Q_FORMAT_AYUV_32,
Q_FORMAT_I444_24,
Q_FORMAT_YUYV_16,
Q_FORMAT_UYVY_16,
Q_FORMAT_I420_12,
Q_FORMAT_YV12_12,
Q_FORMAT_NV21_12,
Q_FORMAT_NV12_12,
// ASTC Format
Q_FORMAT_ASTC_8,
Q_FORMAT_ASTC_16,
};
public enum texgenpack_texturetype
{
RGTC1,
RGTC2,
BPTC_FLOAT,
BPTC
}
}

View File

@@ -0,0 +1,93 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;
using BrotliSharpLib;
namespace UnityStudio
{
public class WebFile
{
public static byte[] gzipMagic = { 0x1f, 0x8b };
public static byte[] brotliMagic = { 0x62, 0x72, 0x6F, 0x74, 0x6C, 0x69 };
public List<MemoryFile> fileList = new List<MemoryFile>();
public class WebData
{
public int dataOffset;
public int dataLength;
public string path;
}
public WebFile(EndianBinaryReader reader)
{
var magic = reader.ReadBytes(2);
reader.Position = 0;
if (gzipMagic.SequenceEqual(magic))
{
var stream = new MemoryStream();
using (var gs = new GZipStream(reader.BaseStream, CompressionMode.Decompress))
{
gs.CopyTo(stream);
}
stream.Position = 0;
using (reader = new EndianBinaryReader(stream, EndianType.LittleEndian))
{
ReadUnityWebData(reader);
}
}
else
{
reader.Position = 0x20;
magic = reader.ReadBytes(6);
reader.Position = 0;
if (brotliMagic.SequenceEqual(magic))
{
var buff = reader.ReadBytes((int)reader.BaseStream.Length);
var uncompressedData = Brotli.DecompressBuffer(buff, 0, buff.Length);
var stream = new MemoryStream(uncompressedData);
using (reader = new EndianBinaryReader(stream, EndianType.LittleEndian))
{
ReadUnityWebData(reader);
}
}
else
{
reader.endian = EndianType.LittleEndian;
ReadUnityWebData(reader);
}
}
}
private void ReadUnityWebData(EndianBinaryReader reader)
{
var signature = reader.ReadStringToNull();
if (signature != "UnityWebData1.0")
return;
var headLength = reader.ReadInt32();
var dataList = new List<WebData>();
while (reader.Position < headLength)
{
var data = new WebData();
data.dataOffset = reader.ReadInt32();
data.dataLength = reader.ReadInt32();
var pathLength = reader.ReadInt32();
data.path = Encoding.UTF8.GetString(reader.ReadBytes(pathLength));
dataList.Add(data);
}
foreach (var data in dataList)
{
var file = new MemoryFile();
file.fileName = Path.GetFileName(data.path);
reader.Position = data.dataOffset;
file.stream = new MemoryStream(reader.ReadBytes(data.dataLength));
fileList.Add(file);
}
}
}
}

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>UnityStudio</RootNamespace>
<AssemblyName>UnityStudio</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="BrotliSharpLib, Version=0.2.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>library\BrotliSharpLib.dll</HintPath>
<Private>False</Private>
</Reference>
<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="OpenFolderDialog.cs" />
<Compile Include="Classes\AssetBundle.cs" />
<Compile Include="Classes\MovieTexture.cs" />
<Compile Include="Classes\Sprite.cs" />
<Compile Include="Classes\SpriteAtlas.cs" />
<Compile Include="Classes\VideoClip.cs" />
<Compile Include="StudioClasses\AssetPreloadData.cs" />
<Compile Include="Classes\AudioClip.cs" />
<Compile Include="Classes\BuildSettings.cs" />
<Compile Include="StudioClasses\BundleFile.cs" />
<Compile Include="StudioClasses\ClassStruct.cs" />
<Compile Include="StudioClasses\FBXExporter.cs" />
<Compile Include="StudioClasses\ShaderResource.Designer.cs">
<DependentUpon>ShaderResource.resx</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="StudioClasses\SpriteHelper.cs" />
<Compile Include="StudioClasses\StringExtensions.cs" />
<Compile Include="StudioClasses\EndianBinaryReader.cs" />
<Compile Include="StudioClasses\Texture2DConverter.cs" />
<Compile Include="StudioClasses\Enums.cs" />
<Compile Include="StudioClasses\Exporter.cs" />
<Compile Include="StudioClasses\Importer.cs" />
<Compile Include="StudioClasses\Studio.cs" />
<Compile Include="StudioClasses\ClassIDReference.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="Classes\Font.cs" />
<Compile Include="GOHierarchy.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Lz4DecoderStream.cs" />
<Compile Include="Classes\Material.cs" />
<Compile Include="Classes\Mesh.cs" />
<Compile Include="Classes\GameObject.cs" />
<Compile Include="StudioClasses\PPtrHelpers.cs" />
<Compile Include="Classes\MonoBehaviour.cs" />
<Compile Include="Classes\PlayerSettings.cs" />
<Compile Include="Classes\RectTransform.cs" />
<Compile Include="Classes\MeshRenderer.cs" />
<Compile Include="Classes\Shader.cs" />
<Compile Include="Classes\SkinnedMeshRenderer.cs" />
<Compile Include="Classes\MeshFilter.cs" />
<Compile Include="Classes\TextAsset.cs" />
<Compile Include="Classes\Texture2D.cs" />
<Compile Include="Classes\Transform.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="StudioClasses\AssetsFile.cs" />
<Compile Include="StudioClasses\WebFile.cs" />
<Compile Include="UnityStudioForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UnityStudioForm.Designer.cs">
<DependentUpon>UnityStudioForm.cs</DependentUpon>
</Compile>
<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="StudioClasses\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

@@ -0,0 +1,271 @@
<?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>{24551E2D-E9B6-4CD6-8F2A-D9F4A13E7853}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UnityStudio</RootNamespace>
<AssemblyName>UnityStudio</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 Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Reference Include="BrotliSharpLib, Version=0.2.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>library\BrotliSharpLib.dll</HintPath>
<Private>False</Private>
</Reference>
<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="OpenFolderDialog.cs" />
<Compile Include="StudioClasses\ShaderResource.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>ShaderResource.resx</DependentUpon>
</Compile>
<Compile Include="Classes\AssetBundle.cs" />
<Compile Include="Classes\MovieTexture.cs" />
<Compile Include="Classes\Sprite.cs" />
<Compile Include="Classes\SpriteAtlas.cs" />
<Compile Include="Classes\VideoClip.cs" />
<Compile Include="StudioClasses\AssetPreloadData.cs" />
<Compile Include="Classes\AudioClip.cs" />
<Compile Include="Classes\BuildSettings.cs" />
<Compile Include="StudioClasses\BundleFile.cs" />
<Compile Include="StudioClasses\ClassStruct.cs" />
<Compile Include="StudioClasses\FBXExporter.cs" />
<Compile Include="StudioClasses\SpriteHelper.cs" />
<Compile Include="StudioClasses\StringExtensions.cs" />
<Compile Include="StudioClasses\Texture2DConverter.cs" />
<Compile Include="StudioClasses\Enums.cs" />
<Compile Include="StudioClasses\Exporter.cs" />
<Compile Include="StudioClasses\Importer.cs" />
<Compile Include="StudioClasses\Studio.cs" />
<Compile Include="StudioClasses\ClassIDReference.cs" />
<Compile Include="StudioClasses\EndianBinaryReader.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="Classes\Font.cs" />
<Compile Include="GOHierarchy.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Lz4DecoderStream.cs" />
<Compile Include="Classes\Material.cs" />
<Compile Include="Classes\Mesh.cs" />
<Compile Include="Classes\GameObject.cs" />
<Compile Include="StudioClasses\PPtrHelpers.cs" />
<Compile Include="Classes\MonoBehaviour.cs" />
<Compile Include="Classes\PlayerSettings.cs" />
<Compile Include="Classes\RectTransform.cs" />
<Compile Include="Classes\MeshRenderer.cs" />
<Compile Include="Classes\Shader.cs" />
<Compile Include="Classes\SkinnedMeshRenderer.cs" />
<Compile Include="Classes\MeshFilter.cs" />
<Compile Include="Classes\TextAsset.cs" />
<Compile Include="Classes\Texture2D.cs" />
<Compile Include="Classes\Transform.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="StudioClasses\AssetsFile.cs" />
<Compile Include="StudioClasses\WebFile.cs" />
<Compile Include="UnityStudioForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UnityStudioForm.Designer.cs">
<DependentUpon>UnityStudioForm.cs</DependentUpon>
</Compile>
<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="StudioClasses\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">
<SubType>Designer</SubType>
</None>
<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>

962
UnityStudio/UnityStudioForm.Designer.cs generated Normal file
View File

@@ -0,0 +1,962 @@
namespace UnityStudio
{
partial class UnityStudioForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UnityStudioForm));
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.loadFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.loadFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.extractBundleToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.extractFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.debugMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.buildClassStructuresMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.dontLoadAssetsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.dontBuildHierarchyMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
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();
this.assetGroupOptions = new System.Windows.Forms.ToolStripComboBox();
this.showExpOpt = new System.Windows.Forms.ToolStripMenuItem();
this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportAllAssetsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportSelectedAssetsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportFilteredAssetsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this._3DToolStripMenuItem = 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.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
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();
this.columnHeaderName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeaderType = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeaderSize = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.listSearch = new System.Windows.Forms.TextBox();
this.progressbarPanel = new System.Windows.Forms.Panel();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.previewPanel = new System.Windows.Forms.Panel();
this.assetInfoLabel = new System.Windows.Forms.Label();
this.FMODpanel = new System.Windows.Forms.Panel();
this.FMODcopyright = new System.Windows.Forms.Label();
this.FMODinfoLabel = new System.Windows.Forms.Label();
this.FMODtimerLabel = new System.Windows.Forms.Label();
this.FMODstatusLabel = new System.Windows.Forms.Label();
this.FMODprogressBar = new System.Windows.Forms.TrackBar();
this.FMODvolumeBar = new System.Windows.Forms.TrackBar();
this.FMODloopButton = new System.Windows.Forms.CheckBox();
this.FMODstopButton = new System.Windows.Forms.Button();
this.FMODpauseButton = new System.Windows.Forms.Button();
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();
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.classesListView = new System.Windows.Forms.ListView();
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.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.treeTip = new System.Windows.Forms.ToolTip(this.components);
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();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.progressbarPanel.SuspendLayout();
this.previewPanel.SuspendLayout();
this.FMODpanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.FMODprogressBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.FMODvolumeBar)).BeginInit();
this.classPreviewPanel.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.tabPage3.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.debugMenuItem,
this.optionsToolStripMenuItem,
this.exportToolStripMenuItem,
this._3DToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(1264, 25);
this.menuStrip1.TabIndex = 0;
this.menuStrip1.Text = "menuStrip1";
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.loadFileToolStripMenuItem,
this.loadFolderToolStripMenuItem,
this.toolStripMenuItem1,
this.extractBundleToolStripMenuItem,
this.extractFolderToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(39, 21);
this.fileToolStripMenuItem.Text = "File";
//
// loadFileToolStripMenuItem
//
this.loadFileToolStripMenuItem.Name = "loadFileToolStripMenuItem";
this.loadFileToolStripMenuItem.Size = new System.Drawing.Size(159, 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(159, 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(156, 6);
//
// extractBundleToolStripMenuItem
//
this.extractBundleToolStripMenuItem.Name = "extractBundleToolStripMenuItem";
this.extractBundleToolStripMenuItem.Size = new System.Drawing.Size(159, 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(159, 22);
this.extractFolderToolStripMenuItem.Text = "Extract folder";
this.extractFolderToolStripMenuItem.Click += new System.EventHandler(this.extractFolderToolStripMenuItem_Click);
//
// debugMenuItem
//
this.debugMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.buildClassStructuresMenuItem,
this.dontLoadAssetsMenuItem,
this.dontBuildHierarchyMenuItem,
this.toolStripSeparator2,
this.exportClassStructuresMenuItem});
this.debugMenuItem.Name = "debugMenuItem";
this.debugMenuItem.Size = new System.Drawing.Size(87, 21);
this.debugMenuItem.Text = "Diagnostics";
this.debugMenuItem.Visible = false;
//
// buildClassStructuresMenuItem
//
this.buildClassStructuresMenuItem.CheckOnClick = true;
this.buildClassStructuresMenuItem.Name = "buildClassStructuresMenuItem";
this.buildClassStructuresMenuItem.Size = new System.Drawing.Size(224, 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.Text = "Don\'t load assets";
this.dontLoadAssetsMenuItem.CheckedChanged += new System.EventHandler(this.dontLoadAssetsMenuItem_CheckedChanged);
//
// dontBuildHierarchyMenuItem
//
this.dontBuildHierarchyMenuItem.CheckOnClick = true;
this.dontBuildHierarchyMenuItem.Name = "dontBuildHierarchyMenuItem";
this.dontBuildHierarchyMenuItem.Size = new System.Drawing.Size(224, 22);
this.dontBuildHierarchyMenuItem.Text = "Don\'t build hierarchy tree";
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(221, 6);
//
// exportClassStructuresMenuItem
//
this.exportClassStructuresMenuItem.Name = "exportClassStructuresMenuItem";
this.exportClassStructuresMenuItem.Size = new System.Drawing.Size(224, 22);
this.exportClassStructuresMenuItem.Text = "Export class structures";
this.exportClassStructuresMenuItem.Click += new System.EventHandler(this.exportClassStructuresMenuItem_Click);
//
// optionsToolStripMenuItem
//
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.Text = "Options";
//
// displayAll
//
this.displayAll.CheckOnClick = true;
this.displayAll.Name = "displayAll";
this.displayAll.Size = new System.Drawing.Size(252, 22);
this.displayAll.Text = "Display all assets";
this.displayAll.ToolTipText = "Check this option will display all types assets. Not extractable assets can expor" +
"t the RAW file.";
this.displayAll.CheckedChanged += new System.EventHandler(this.MenuItem_CheckedChanged);
//
// 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);
//
// enablePreview
//
this.enablePreview.Checked = true;
this.enablePreview.CheckOnClick = true;
this.enablePreview.CheckState = System.Windows.Forms.CheckState.Checked;
this.enablePreview.Name = "enablePreview";
this.enablePreview.Size = new System.Drawing.Size(252, 22);
this.enablePreview.Text = "Enable preview";
this.enablePreview.ToolTipText = "Toggle the loading and preview of readable assets, such as images, sounds, text, " +
"etc.\r\nDisable preview if you have performance or compatibility issues.";
this.enablePreview.CheckedChanged += new System.EventHandler(this.enablePreview_Check);
//
// displayInfo
//
this.displayInfo.Checked = true;
this.displayInfo.CheckOnClick = true;
this.displayInfo.CheckState = System.Windows.Forms.CheckState.Checked;
this.displayInfo.Name = "displayInfo";
this.displayInfo.Size = new System.Drawing.Size(252, 22);
this.displayInfo.Text = "Display asset infromation";
this.displayInfo.ToolTipText = "Toggle the overlay that shows information about each asset, eg. image size, forma" +
"t, audio bitrate, etc.";
this.displayInfo.CheckedChanged += new System.EventHandler(this.displayAssetInfo_Check);
//
// openAfterExport
//
this.openAfterExport.Checked = true;
this.openAfterExport.CheckOnClick = true;
this.openAfterExport.CheckState = System.Windows.Forms.CheckState.Checked;
this.openAfterExport.Name = "openAfterExport";
this.openAfterExport.Size = new System.Drawing.Size(252, 22);
this.openAfterExport.Text = "Open file/folder after export";
this.openAfterExport.CheckedChanged += new System.EventHandler(this.MenuItem_CheckedChanged);
//
// assetGroupOptions
//
this.assetGroupOptions.Items.AddRange(new object[] {
"Group exported assets by type",
"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.SelectedIndexChanged += new System.EventHandler(this.assetGroupOptions_SelectedIndexChanged);
//
// showExpOpt
//
this.showExpOpt.Name = "showExpOpt";
this.showExpOpt.Size = new System.Drawing.Size(252, 22);
this.showExpOpt.Text = "Export options";
this.showExpOpt.Click += new System.EventHandler(this.showExpOpt_Click);
//
// exportToolStripMenuItem
//
this.exportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.exportAllAssetsMenuItem,
this.exportSelectedAssetsMenuItem,
this.exportFilteredAssetsMenuItem});
this.exportToolStripMenuItem.Name = "exportToolStripMenuItem";
this.exportToolStripMenuItem.Size = new System.Drawing.Size(58, 21);
this.exportToolStripMenuItem.Text = "Export";
this.exportToolStripMenuItem.Visible = false;
//
// exportAllAssetsMenuItem
//
this.exportAllAssetsMenuItem.Name = "exportAllAssetsMenuItem";
this.exportAllAssetsMenuItem.Size = new System.Drawing.Size(165, 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(165, 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(165, 22);
this.exportFilteredAssetsMenuItem.Text = "Filtered assets";
this.exportFilteredAssetsMenuItem.Click += new System.EventHandler(this.ExportAssets_Click);
//
// _3DToolStripMenuItem
//
this._3DToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.exportAll3DMenuItem,
this.all3DObjectssplitToolStripMenuItem,
this.exportSelected3DMenuItem});
this._3DToolStripMenuItem.Name = "_3DToolStripMenuItem";
this._3DToolStripMenuItem.Size = new System.Drawing.Size(78, 21);
this._3DToolStripMenuItem.Text = "3D Model";
//
// exportAll3DMenuItem
//
this.exportAll3DMenuItem.Name = "exportAll3DMenuItem";
this.exportAll3DMenuItem.Size = new System.Drawing.Size(234, 22);
this.exportAll3DMenuItem.Text = "Export All 3D objects";
this.exportAll3DMenuItem.Click += new System.EventHandler(this.Export3DObjects_Click);
//
// all3DObjectssplitToolStripMenuItem
//
this.all3DObjectssplitToolStripMenuItem.Name = "all3DObjectssplitToolStripMenuItem";
this.all3DObjectssplitToolStripMenuItem.Size = new System.Drawing.Size(234, 22);
this.all3DObjectssplitToolStripMenuItem.Text = "Export 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(234, 22);
this.exportSelected3DMenuItem.Text = "Export Selected 3D objects";
this.exportSelected3DMenuItem.Click += new System.EventHandler(this.Export3DObjects_Click);
//
// splitContainer1
//
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.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.tabControl1);
this.splitContainer1.Panel1.Controls.Add(this.progressbarPanel);
this.splitContainer1.Panel1MinSize = 200;
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.previewPanel);
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, 656);
this.splitContainer1.SplitterDistance = 420;
this.splitContainer1.TabIndex = 2;
this.splitContainer1.TabStop = false;
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Location = new System.Drawing.Point(0, 0);
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, 634);
this.tabControl1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
this.tabControl1.TabIndex = 0;
this.tabControl1.Selected += new System.Windows.Forms.TabControlEventHandler(this.tabPageSelected);
//
// tabPage1
//
this.tabPage1.Controls.Add(this.sceneTreeView);
this.tabPage1.Controls.Add(this.treeSearch);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(410, 608);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Scene Hierarchy";
this.tabPage1.UseVisualStyleBackColor = true;
//
// sceneTreeView
//
this.sceneTreeView.CheckBoxes = true;
this.sceneTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.sceneTreeView.HideSelection = false;
this.sceneTreeView.Location = new System.Drawing.Point(0, 21);
this.sceneTreeView.Name = "sceneTreeView";
this.sceneTreeView.Size = new System.Drawing.Size(410, 587);
this.sceneTreeView.TabIndex = 1;
this.sceneTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.sceneTreeView_AfterCheck);
//
// treeSearch
//
this.treeSearch.Dock = System.Windows.Forms.DockStyle.Top;
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.TabIndex = 0;
this.treeSearch.Text = " Search ";
this.treeSearch.TextChanged += new System.EventHandler(this.treeSearch_TextChanged);
this.treeSearch.Enter += new System.EventHandler(this.treeSearch_Enter);
this.treeSearch.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeSearch_KeyDown);
this.treeSearch.Leave += new System.EventHandler(this.treeSearch_Leave);
this.treeSearch.MouseEnter += new System.EventHandler(this.treeSearch_MouseEnter);
//
// tabPage2
//
this.tabPage2.Controls.Add(this.assetListView);
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, 608);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Asset List";
this.tabPage2.UseVisualStyleBackColor = true;
this.tabPage2.Resize += new System.EventHandler(this.tabPage2_Resize);
//
// assetListView
//
this.assetListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeaderName,
this.columnHeaderType,
this.columnHeaderSize});
this.assetListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.assetListView.FullRowSelect = true;
this.assetListView.GridLines = true;
this.assetListView.HideSelection = false;
this.assetListView.LabelEdit = true;
this.assetListView.Location = new System.Drawing.Point(0, 21);
this.assetListView.Name = "assetListView";
this.assetListView.Size = new System.Drawing.Size(410, 587);
this.assetListView.TabIndex = 1;
this.assetListView.UseCompatibleStateImageBehavior = false;
this.assetListView.View = System.Windows.Forms.View.Details;
this.assetListView.VirtualMode = true;
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
//
this.columnHeaderName.Text = "Name";
this.columnHeaderName.Width = 240;
//
// columnHeaderType
//
this.columnHeaderType.Text = "Type";
this.columnHeaderType.Width = 88;
//
// columnHeaderSize
//
this.columnHeaderSize.Text = "Size";
this.columnHeaderSize.Width = 23;
//
// listSearch
//
this.listSearch.Dock = System.Windows.Forms.DockStyle.Top;
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.TabIndex = 0;
this.listSearch.Text = " Filter ";
this.listSearch.TextChanged += new System.EventHandler(this.ListSearchTextChanged);
this.listSearch.Enter += new System.EventHandler(this.listSearch_Enter);
this.listSearch.Leave += new System.EventHandler(this.listSearch_Leave);
//
// progressbarPanel
//
this.progressbarPanel.Controls.Add(this.progressBar1);
this.progressbarPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
this.progressbarPanel.Location = new System.Drawing.Point(0, 634);
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.TabIndex = 2;
//
// progressBar1
//
this.progressBar1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.progressBar1.Location = new System.Drawing.Point(1, 2);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(416, 17);
this.progressBar1.Step = 1;
this.progressBar1.TabIndex = 1;
//
// previewPanel
//
this.previewPanel.BackColor = System.Drawing.SystemColors.ControlDark;
this.previewPanel.BackgroundImage = global::UnityStudio.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, 632);
this.previewPanel.TabIndex = 1;
//
// assetInfoLabel
//
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.Name = "assetInfoLabel";
this.assetInfoLabel.Size = new System.Drawing.Size(0, 12);
this.assetInfoLabel.TabIndex = 0;
//
// FMODpanel
//
this.FMODpanel.BackColor = System.Drawing.SystemColors.ControlDark;
this.FMODpanel.Controls.Add(this.FMODcopyright);
this.FMODpanel.Controls.Add(this.FMODinfoLabel);
this.FMODpanel.Controls.Add(this.FMODtimerLabel);
this.FMODpanel.Controls.Add(this.FMODstatusLabel);
this.FMODpanel.Controls.Add(this.FMODprogressBar);
this.FMODpanel.Controls.Add(this.FMODvolumeBar);
this.FMODpanel.Controls.Add(this.FMODloopButton);
this.FMODpanel.Controls.Add(this.FMODstopButton);
this.FMODpanel.Controls.Add(this.FMODpauseButton);
this.FMODpanel.Controls.Add(this.FMODplayButton);
this.FMODpanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.FMODpanel.Location = new System.Drawing.Point(0, 0);
this.FMODpanel.Name = "FMODpanel";
this.FMODpanel.Size = new System.Drawing.Size(838, 632);
this.FMODpanel.TabIndex = 2;
this.FMODpanel.Visible = false;
//
// FMODcopyright
//
this.FMODcopyright.AutoSize = true;
this.FMODcopyright.ForeColor = System.Drawing.SystemColors.ControlLight;
this.FMODcopyright.Location = new System.Drawing.Point(249, 351);
this.FMODcopyright.Name = "FMODcopyright";
this.FMODcopyright.Size = new System.Drawing.Size(341, 12);
this.FMODcopyright.TabIndex = 9;
this.FMODcopyright.Text = "Audio Engine supplied by FMOD by Firelight Technologies.";
//
// FMODinfoLabel
//
this.FMODinfoLabel.AutoSize = true;
this.FMODinfoLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.FMODinfoLabel.Location = new System.Drawing.Point(305, 250);
this.FMODinfoLabel.Name = "FMODinfoLabel";
this.FMODinfoLabel.Size = new System.Drawing.Size(0, 12);
this.FMODinfoLabel.TabIndex = 8;
//
// FMODtimerLabel
//
this.FMODtimerLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.FMODtimerLabel.Location = new System.Drawing.Point(440, 250);
this.FMODtimerLabel.Name = "FMODtimerLabel";
this.FMODtimerLabel.Size = new System.Drawing.Size(155, 12);
this.FMODtimerLabel.TabIndex = 7;
this.FMODtimerLabel.Text = "0:00.0 / 0:00.0";
this.FMODtimerLabel.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// FMODstatusLabel
//
this.FMODstatusLabel.ForeColor = System.Drawing.SystemColors.ControlLightLight;
this.FMODstatusLabel.Location = new System.Drawing.Point(249, 250);
this.FMODstatusLabel.Name = "FMODstatusLabel";
this.FMODstatusLabel.Size = new System.Drawing.Size(50, 12);
this.FMODstatusLabel.TabIndex = 6;
this.FMODstatusLabel.Text = "Stopped";
//
// FMODprogressBar
//
this.FMODprogressBar.AutoSize = false;
this.FMODprogressBar.Location = new System.Drawing.Point(249, 268);
this.FMODprogressBar.Maximum = 1000;
this.FMODprogressBar.Name = "FMODprogressBar";
this.FMODprogressBar.Size = new System.Drawing.Size(350, 22);
this.FMODprogressBar.TabIndex = 5;
this.FMODprogressBar.TickStyle = System.Windows.Forms.TickStyle.None;
this.FMODprogressBar.Scroll += new System.EventHandler(this.FMODprogressBar_Scroll);
this.FMODprogressBar.MouseDown += new System.Windows.Forms.MouseEventHandler(this.FMODprogressBar_MouseDown);
this.FMODprogressBar.MouseUp += new System.Windows.Forms.MouseEventHandler(this.FMODprogressBar_MouseUp);
//
// FMODvolumeBar
//
this.FMODvolumeBar.LargeChange = 2;
this.FMODvolumeBar.Location = new System.Drawing.Point(496, 295);
this.FMODvolumeBar.Name = "FMODvolumeBar";
this.FMODvolumeBar.Size = new System.Drawing.Size(104, 45);
this.FMODvolumeBar.TabIndex = 4;
this.FMODvolumeBar.TickStyle = System.Windows.Forms.TickStyle.Both;
this.FMODvolumeBar.Value = 8;
this.FMODvolumeBar.ValueChanged += new System.EventHandler(this.FMODvolumeBar_ValueChanged);
//
// FMODloopButton
//
this.FMODloopButton.Appearance = System.Windows.Forms.Appearance.Button;
this.FMODloopButton.Location = new System.Drawing.Point(435, 295);
this.FMODloopButton.Name = "FMODloopButton";
this.FMODloopButton.Size = new System.Drawing.Size(55, 42);
this.FMODloopButton.TabIndex = 3;
this.FMODloopButton.Text = "Loop";
this.FMODloopButton.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.FMODloopButton.UseVisualStyleBackColor = true;
this.FMODloopButton.CheckedChanged += new System.EventHandler(this.FMODloopButton_CheckedChanged);
//
// FMODstopButton
//
this.FMODstopButton.Location = new System.Drawing.Point(374, 295);
this.FMODstopButton.Name = "FMODstopButton";
this.FMODstopButton.Size = new System.Drawing.Size(55, 42);
this.FMODstopButton.TabIndex = 2;
this.FMODstopButton.Text = "Stop";
this.FMODstopButton.UseVisualStyleBackColor = true;
this.FMODstopButton.Click += new System.EventHandler(this.FMODstopButton_Click);
//
// FMODpauseButton
//
this.FMODpauseButton.Location = new System.Drawing.Point(313, 295);
this.FMODpauseButton.Name = "FMODpauseButton";
this.FMODpauseButton.Size = new System.Drawing.Size(55, 42);
this.FMODpauseButton.TabIndex = 1;
this.FMODpauseButton.Text = "Pause";
this.FMODpauseButton.UseVisualStyleBackColor = true;
this.FMODpauseButton.Click += new System.EventHandler(this.FMODpauseButton_Click);
//
// FMODplayButton
//
this.FMODplayButton.Location = new System.Drawing.Point(252, 295);
this.FMODplayButton.Name = "FMODplayButton";
this.FMODplayButton.Size = new System.Drawing.Size(55, 42);
this.FMODplayButton.TabIndex = 0;
this.FMODplayButton.Text = "Play";
this.FMODplayButton.UseVisualStyleBackColor = true;
this.FMODplayButton.Click += new System.EventHandler(this.FMODplayButton_Click);
//
// fontPreviewBox
//
this.fontPreviewBox.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.fontPreviewBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.fontPreviewBox.Location = new System.Drawing.Point(0, 0);
this.fontPreviewBox.Name = "fontPreviewBox";
this.fontPreviewBox.ReadOnly = true;
this.fontPreviewBox.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
this.fontPreviewBox.Size = new System.Drawing.Size(838, 632);
this.fontPreviewBox.TabIndex = 0;
this.fontPreviewBox.Text = resources.GetString("fontPreviewBox.Text");
this.fontPreviewBox.Visible = false;
this.fontPreviewBox.WordWrap = false;
//
// textPreviewBox
//
this.textPreviewBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.textPreviewBox.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textPreviewBox.Location = new System.Drawing.Point(0, 0);
this.textPreviewBox.Multiline = true;
this.textPreviewBox.Name = "textPreviewBox";
this.textPreviewBox.ReadOnly = true;
this.textPreviewBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.textPreviewBox.Size = new System.Drawing.Size(838, 632);
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, 632);
this.glControl1.TabIndex = 4;
this.glControl1.VSync = false;
this.glControl1.Paint += new System.Windows.Forms.PaintEventHandler(this.glControl1_Paint);
this.glControl1.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.glControl1_MouseWheel);
//
// 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, 632);
this.classPreviewPanel.TabIndex = 3;
this.classPreviewPanel.Visible = false;
//
// classTextBox
//
this.classTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.classTextBox.Location = new System.Drawing.Point(0, 0);
this.classTextBox.Multiline = true;
this.classTextBox.Name = "classTextBox";
this.classTextBox.ReadOnly = true;
this.classTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.classTextBox.Size = new System.Drawing.Size(838, 632);
this.classTextBox.TabIndex = 3;
this.classTextBox.WordWrap = false;
//
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatusLabel1});
this.statusStrip1.Location = new System.Drawing.Point(0, 632);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(838, 22);
this.statusStrip1.TabIndex = 2;
this.statusStrip1.Text = "statusStrip1";
//
// toolStripStatusLabel1
//
this.toolStripStatusLabel1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(823, 17);
this.toolStripStatusLabel1.Spring = true;
this.toolStripStatusLabel1.Text = "Ready to go";
this.toolStripStatusLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// tabPage3
//
this.tabPage3.Controls.Add(this.classesListView);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(410, 608);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "Asset Classes";
this.tabPage3.UseVisualStyleBackColor = true;
//
// classesListView
//
this.classesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2});
this.classesListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.classesListView.FullRowSelect = true;
this.classesListView.Location = new System.Drawing.Point(0, 0);
this.classesListView.MultiSelect = false;
this.classesListView.Name = "classesListView";
this.classesListView.Size = new System.Drawing.Size(410, 608);
this.classesListView.TabIndex = 0;
this.classesListView.UseCompatibleStateImageBehavior = false;
this.classesListView.View = System.Windows.Forms.View.Details;
this.classesListView.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.classesListView_ItemSelectionChanged);
//
// columnHeader1
//
this.columnHeader1.DisplayIndex = 1;
this.columnHeader1.Text = "Name";
this.columnHeader1.Width = 328;
//
// columnHeader2
//
this.columnHeader2.DisplayIndex = 0;
this.columnHeader2.Text = "ID";
//
// timer
//
this.timer.Interval = 10;
this.timer.Tick += new System.EventHandler(this.timer_Tick);
//
// timerOpenTK
//
this.timerOpenTK.Interval = 166;
this.timerOpenTK.Tick += new System.EventHandler(this.timerOpenTK_Tick);
//
// openFileDialog1
//
this.openFileDialog1.AddExtension = false;
this.openFileDialog1.Filter = "Unity files|*.*";
this.openFileDialog1.Multiselect = true;
this.openFileDialog1.RestoreDirectory = true;
//
// saveFileDialog1
//
this.saveFileDialog1.Filter = "FBX file|*.fbx";
this.saveFileDialog1.RestoreDirectory = true;
//
// contextMenuStrip1
//
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(176, 26);
//
// showOriginalFileToolStripMenuItem
//
this.showOriginalFileToolStripMenuItem.Name = "showOriginalFileToolStripMenuItem";
this.showOriginalFileToolStripMenuItem.Size = new System.Drawing.Size(175, 22);
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.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1264, 681);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.menuStrip1);
this.Icon = global::UnityStudio.Properties.Resources.unity;
this.KeyPreview = true;
this.MainMenuStrip = this.menuStrip1;
this.MinimumSize = new System.Drawing.Size(620, 372);
this.Name = "UnityStudioForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "UnityStudio";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.UnityStudioForm_KeyDown);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
this.progressbarPanel.ResumeLayout(false);
this.previewPanel.ResumeLayout(false);
this.previewPanel.PerformLayout();
this.FMODpanel.ResumeLayout(false);
this.FMODpanel.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.FMODprogressBar)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.FMODvolumeBar)).EndInit();
this.classPreviewPanel.ResumeLayout(false);
this.classPreviewPanel.PerformLayout();
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.tabPage3.ResumeLayout(false);
this.contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.TextBox treeSearch;
private System.Windows.Forms.TextBox listSearch;
private System.Windows.Forms.ToolStripMenuItem loadFileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem loadFolderToolStripMenuItem;
private System.Windows.Forms.ListView assetListView;
private System.Windows.Forms.ColumnHeader columnHeaderName;
private System.Windows.Forms.ColumnHeader columnHeaderSize;
private System.Windows.Forms.ColumnHeader columnHeaderType;
private System.Windows.Forms.ToolStripMenuItem exportToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportAllAssetsMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportSelectedAssetsMenuItem;
private System.Windows.Forms.Panel previewPanel;
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
private System.Windows.Forms.Panel progressbarPanel;
private System.Windows.Forms.ToolStripMenuItem exportFilteredAssetsMenuItem;
private System.Windows.Forms.ToolStripMenuItem _3DToolStripMenuItem;
private System.Windows.Forms.Label assetInfoLabel;
private System.Windows.Forms.TextBox textPreviewBox;
private System.Windows.Forms.RichTextBox fontPreviewBox;
private System.Windows.Forms.Panel FMODpanel;
private System.Windows.Forms.TrackBar FMODvolumeBar;
private System.Windows.Forms.CheckBox FMODloopButton;
private System.Windows.Forms.Button FMODstopButton;
private System.Windows.Forms.Button FMODpauseButton;
private System.Windows.Forms.Button FMODplayButton;
private System.Windows.Forms.TrackBar FMODprogressBar;
private System.Windows.Forms.Label FMODstatusLabel;
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 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;
private System.Windows.Forms.ToolStripMenuItem extractBundleToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem extractFolderToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportAll3DMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportSelected3DMenuItem;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
private System.Windows.Forms.ToolStripComboBox assetGroupOptions;
private System.Windows.Forms.ToolStripMenuItem openAfterExport;
private System.Windows.Forms.ToolStripMenuItem showExpOpt;
private GOHierarchy sceneTreeView;
private System.Windows.Forms.ToolTip treeTip;
private System.Windows.Forms.ToolStripMenuItem debugMenuItem;
private System.Windows.Forms.ToolStripMenuItem buildClassStructuresMenuItem;
private System.Windows.Forms.ToolStripMenuItem dontLoadAssetsMenuItem;
private System.Windows.Forms.ToolStripMenuItem dontBuildHierarchyMenuItem;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.ListView classesListView;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.Panel classPreviewPanel;
private System.Windows.Forms.TextBox classTextBox;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
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;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,165 @@
<?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>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>312, 17</value>
</metadata>
<data name="fontPreviewBox.Text" xml:space="preserve">
<value>abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWYZ
1234567890.:,;'\"(!?)+-*/=
The quick brown fox jumps over the lazy dog. 1234567890
The quick brown fox jumps over the lazy dog. 1234567890
The quick brown fox jumps over the lazy dog. 1234567890
The quick brown fox jumps over the lazy dog. 1234567890
The quick brown fox jumps over the lazy dog. 1234567890
The quick brown fox jumps over the lazy dog. 1234567890
The quick brown fox jumps over the lazy dog. 1234567890</value>
</data>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>432, 17</value>
</metadata>
<metadata name="timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>553, 17</value>
</metadata>
<metadata name="timerOpenTK.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>636, 17</value>
</metadata>
<metadata name="saveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>784, 17</value>
</metadata>
<metadata name="treeTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>928, 17</value>
</metadata>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>147, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>67</value>
</metadata>
</root>

75
UnityStudio/app.config Normal file
View File

@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="Unity_Studio.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<userSettings>
<Unity_Studio.Properties.Settings>
<setting name="displayAll" serializeAs="String">
<value>False</value>
</setting>
<setting name="enablePreview" serializeAs="String">
<value>True</value>
</setting>
<setting name="displayInfo" serializeAs="String">
<value>True</value>
</setting>
<setting name="openAfterExport" serializeAs="String">
<value>True</value>
</setting>
<setting name="assetGroupOption" serializeAs="String">
<value>0</value>
</setting>
<setting name="exportNormals" serializeAs="String">
<value>True</value>
</setting>
<setting name="exportTangents" serializeAs="String">
<value>False</value>
</setting>
<setting name="exportUVs" serializeAs="String">
<value>True</value>
</setting>
<setting name="exportColors" serializeAs="String">
<value>True</value>
</setting>
<setting name="scaleFactor" serializeAs="String">
<value>2.54</value>
</setting>
<setting name="upAxis" serializeAs="String">
<value>0</value>
</setting>
<setting name="showExpOpt" serializeAs="String">
<value>False</value>
</setting>
<setting name="exportDeformers" serializeAs="String">
<value>True</value>
</setting>
<setting name="convertDummies" serializeAs="String">
<value>True</value>
</setting>
<setting name="convertTexture" serializeAs="String">
<value>True</value>
</setting>
<setting name="convertAudio" serializeAs="String">
<value>True</value>
</setting>
<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>
<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>

Binary file not shown.

View File

@@ -0,0 +1,151 @@
FMOD, FMOD Ex, FMOD Designer and FMOD Studio are
Copyright <20> 2005-2016 Firelight Technologies Pty, Ltd.
GRANT OF LICENSE
----------------
THIS END USER LICENSE AGREEMENT GRANTS THE USER, THE RIGHT TO USE FMOD,
IN ITS LIBRARY AND TOOL FORM, IN THEIR OWN PRODUCTS, BE THEY FOR PERSONAL,
EDUCATIONAL OR COMMERCIAL USE.
THE USER MUST ADHERE TO THE LICENSING MODEL PROVIDED BY FIRELIGHT
TECHNOLOGIES, AND MUST APPLY FOR A LICENSE IF NECESSARY. THE FOLLOWING
LICENSES ARE AVAILABLE.
FMOD NON-COMMERCIAL LICENSE
------------------------------------
IF YOUR PRODUCT IS NOT INTENDED FOR COMMERCIAL GAIN AND DOES NOT
INCLUDE THE FMOD LIBRARY FOR RESALE, LICENSE OR OTHER COMMERCIAL
DISTRIBUTION, THEN USE OF FMOD IS FREE OF CHARGE. THERE ARE NO
LICENSE FEES FOR NON-COMMERCIAL APPLICATIONS.
THE USER MAY USE THIS EULA AS EVIDENCE OF THEIR LICENSE WITHOUT
CONTACTING FIRELIGHT TECHNOLOGIES.
CONDITIONS/LIMITATIONS:
- WHEN USING THIS LICENSE, THE FMOD LIBRARY CANNOT BE USED FOR
RESALE OR OTHER COMMERCIAL DISTRIBUTION
- THIS LICENSE CANNOT BE USED FOR PRODUCTS WHICH DO NOT MAKE
PROFIT BUT ARE STILL COMMERCIALLY RELEASED
- THIS LICENSE CANNOT BE USED FOR COMMERCIAL SERVICES, WHERE THE
EXECUTABLE CONTAINING FMOD IS NOT SOLD, BUT THE DATA IS.
- WHEN USING FMOD, A CREDIT LINE IS REQUIRED IN EITHER DOCUMENTATION,
OR 'ON SCREEN' FORMAT (IF POSSIBLE). IT SHOULD CONTAIN AT LEAST
THE WORDS "FMOD" (OR "FMOD STUDIO" IF APPLICABLE) AND
"FIRELIGHT TECHNOLOGIES."
LOGOS ARE AVAILABLE FOR BOX OR MANUAL ART, BUT ARE NOT MANDATORY.
AN EXAMPLE CREDIT COULD BE:
FMOD Sound System, copyright <20> Firelight Technologies Pty, Ltd., 1994-2016.
OR
FMOD Studio, copyright <20> Firelight Technologies Pty, Ltd., 1994-2016.
OR
Audio Engine supplied by FMOD by Firelight Technologies.
NOTE THIS IN ADVANCE, AS IT MUST BE DONE BEFORE SHIPPING YOUR
PRODUCT WITH FMOD.
FMOD FREE FOR INDIES LICENSE (FMOD STUDIO ONLY)
------------------------------------------------
INDIE DEVELOPERS ARE CONSIDERED BY OUR LICENSING MODEL, DEVELOPERS THAT DEVELOP
A TITLE FOR UNDER $100K USD (TYPICALLY CONSIDERED AN 'INDIE' TITLE) TOTAL
BUDGET, MEANING YOUR TOTAL COSTS ARE LESS THAN $100K USD AT TIME OF SHIPPING,
YOU CAN USE FMOD FOR FREE.
CONDITIONS/LIMITATIONS
- PLEASE WRITE TO SALES@FMOD.COM WITH THE NAME OF YOUR TITLE, RELEASE DATE
AND PLATFORMS SO WE CAN REGISTER YOU IN OUR SYSTEM.
- THERE IS NO RESTRICTION ON PLATFORM, ANY PLATFORM COMBINATION MAY BE USED.
- INCOME IS NOT RELEVANT TO THE BUDGET LEVEL, IT MUST BE EXPENSE RELATED.
- WHEN USING FMOD, A CREDIT LINE IS REQUIRED IN EITHER DOCUMENTATION,
OR 'ON SCREEN' FORMAT (IF POSSIBLE). IT SHOULD CONTAIN AT LEAST
THE WORDS FMOD STUDIO AND FIRELIGHT TECHNOLOGIES.
LOGOS ARE AVAILABLE FOR BOX OR MANUAL ART, BUT ARE NOT MANDATORY.
AN EXAMPLE CREDIT COULD BE:
FMOD STUDIO, COPYRIGHT <20> FIRELIGHT TECHNOLOGIES PTY, LTD., 1994-2016.
COMMERCIAL USAGE (FMOD EX AND FMOD STUDIO)
------------------------------------------
IF THE PRODUCT THAT USES FMOD IS INTENDED TO GENERATE INCOME, VIA DIRECT SALES
OR INDIRECT REVENUE (SUCH AS ADVERTISING, DONATIONS, CONTRACT FEE) THEN THE
DEVELOPER MUST APPLY TO FIRELIGHT TECHNOLOGIES FOR A COMMERCIAL LICENSE (UNLESS
THE USER QUALIFIES FOR AN FMOD STUDIO 'INDIE LICENSE').
TO APPLY FOR THIS LICENSE WRITE TO SALES@FMOD.COM WITH THE RELEVANT DETAILS.
REDISTRIBUTION LICENSE (FMOD EX AND FMOD STUDIO)
------------------------------------------------
IF THE USER WISHES TO REDISTRIBUTE FMOD AS PART OF AN ENGINE OR TOOL SOLUTION,
THE USER MUST APPLY TO FIRELIGHT TECHNOLOGIES TO BE GRANTED A 'REDISTRIBUTION
LICENSE'.
TO APPLY FOR THIS LICENSE WRITE TO SALES@FMOD.COM WITH THE RELEVANT DETAILS.
WARRANTY AND LIMITATION OF LIABILITY
------------------------------------
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 FOUNDATION
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.
FMOD Uses Ogg Vorbis codec. BSD license.
-----------------------------------------
Copyright (c) 2002, Xiph.org Foundation
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 the Xiph.org Foundation 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 FOUNDATION
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.
For Android platform code.
--------------------------
Copyright (C) 2010 The Android Open Source Project
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.
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.

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.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,22 @@
crunch/crnlib uses the ZLIB license:
http://opensource.org/licenses/Zlib
Copyright (c) 2010-2016 Richard Geldreich, Jr. and Binomial LLC
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

View File

@@ -0,0 +1,13 @@
Copyright (c) 2015 Harm Hanemaaijer <fgenfb@yahoo.com>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More