display message if resource file can't be found

This commit is contained in:
Perfare 2017-09-24 08:27:49 +08:00
parent dc8990115a
commit cc74130ad4
2 changed files with 11 additions and 1 deletions

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Unity_Studio
{
@ -112,7 +113,11 @@ namespace Unity_Studio
if (UnityStudio.assetsfileandstream.TryGetValue(Path.GetFileName(m_Source), out estream))
{
estream.Position = m_Offset;
m_AudioData = estream.ReadBytes((int)m_Size);
m_AudioData = estream.ReadBytes((int) m_Size);
}
else
{
MessageBox.Show($"can't find the resource file {Path.GetFileName(m_Source)}");
}
}
}

View File

@ -4,6 +4,7 @@ using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace Unity_Studio
{
@ -185,6 +186,10 @@ namespace Unity_Studio
estream.Position = offset;
image_data = estream.ReadBytes(image_data_size);
}
else
{
MessageBox.Show($"can't find the resource file {Path.GetFileName(path)}");
}
}
}
else