mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-07-14 02:54:16 -04:00
cleanup code
This commit is contained in:
@ -94,23 +94,21 @@ namespace Unity_Studio
|
||||
|
||||
if (readSwitch)
|
||||
{
|
||||
m_AudioData = new byte[m_Size];
|
||||
|
||||
if (m_Source == null)
|
||||
{
|
||||
a_Stream.Read(m_AudioData, 0, (int)m_Size);
|
||||
m_AudioData = a_Stream.ReadBytes((int)m_Size);
|
||||
}
|
||||
else if (File.Exists(m_Source) ||
|
||||
File.Exists(m_Source = Path.Combine(Path.GetDirectoryName(sourceFile.filePath), Path.GetFileName(m_Source))))
|
||||
{
|
||||
BinaryReader reader = new BinaryReader(File.OpenRead(m_Source));
|
||||
reader.BaseStream.Position = m_Offset;
|
||||
reader.Read(m_AudioData, 0, (int)m_Size);
|
||||
m_AudioData = reader.ReadBytes((int)m_Size);
|
||||
reader.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
EndianStream estream = null;
|
||||
EndianStream estream;
|
||||
if (UnityStudio.assetsfileandstream.TryGetValue(Path.GetFileName(m_Source), out estream))
|
||||
{
|
||||
estream.Position = m_Offset;
|
||||
|
@ -58,10 +58,10 @@ namespace Unity_Studio
|
||||
m_Tag = a_Stream.ReadUInt16();
|
||||
m_IsActive = a_Stream.ReadBoolean();
|
||||
|
||||
base.Text = m_Name;
|
||||
Text = m_Name;
|
||||
preloadData.Text = m_Name;
|
||||
//name should be unique
|
||||
base.Name = uniqueID;
|
||||
Name = uniqueID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -168,15 +168,14 @@ namespace Unity_Studio
|
||||
if (File.Exists(path) ||
|
||||
File.Exists(path = Path.Combine(Path.GetDirectoryName(sourceFile.filePath), Path.GetFileName(path))))
|
||||
{
|
||||
image_data = new byte[image_data_size];
|
||||
BinaryReader reader = new BinaryReader(File.OpenRead(path));
|
||||
reader.BaseStream.Position = offset;
|
||||
reader.Read(image_data, 0, image_data_size);
|
||||
image_data = reader.ReadBytes(image_data_size);
|
||||
reader.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
EndianStream estream = null;
|
||||
EndianStream estream;
|
||||
if (UnityStudio.assetsfileandstream.TryGetValue(Path.GetFileName(path), out estream))
|
||||
{
|
||||
estream.Position = offset;
|
||||
@ -186,8 +185,7 @@ namespace Unity_Studio
|
||||
}
|
||||
else
|
||||
{
|
||||
image_data = new byte[image_data_size];
|
||||
a_Stream.Read(image_data, 0, image_data_size);
|
||||
image_data = a_Stream.ReadBytes(image_data_size);
|
||||
}
|
||||
|
||||
switch (m_TextureFormat)
|
||||
|
Reference in New Issue
Block a user