- Home /
Question by
Elriks · Jan 23, 2012 at 03:41 PM ·
resources.load
Resources.Load for .Dat ?
Hello (sorry for my english),
I have a trouble to load a file type with Unity3D and I wanted to know if it was not from UNITY.
My question : is that I can load a .Dat with the "Resources.Load"?
Example (Filename = File17.dat) :
public void LoadData(string FileName, byte[] DstData)
{
LoadData(FileName, DstData, true);
}
public void LoadData(string FileName, byte[] DstData, bool Needed)
{
StreamReader sr;
//printf("Try to load %s\n", FileName);
object test = Resources.Load(CAwInterfaceEx.GetDataFile(FileName));
Debug.Log(test);
/* Ouvre le fichier. */
try
{
sr = new StreamReader(CAwInterfaceEx.GetDataFile(FileName));
}
catch
{
/* Le fichier n'existe pas. */
if (Needed)
Debug.Log("Warning: can't find file '{0}'" + FileName);
return;
}
Comment
Answer by Kame Sama · Jun 28, 2014 at 12:54 AM
Did you figure it out? I am currently facing this same issue.