Hello
I have a NullReferenceException on a StartCoroutine call, even if i delete all the content of it.
Here is a sample of my code :
public class csGUI : MonoBehaviour
{
void OnGUI()
{
if (GUI.Button(new Rect(560, 0, 50, 20), "open"))
{
csMain.StartLoadingProject(@"my_url");
}
}
}
public static class csMain
{
public static void StartLoadingProject(string lURL)
{
if (mySaveOpen == null)
mySaveOpen = new csSaveAndOpen();
mySaveOpen.OpenFile(lURL, XMLFileType.Project);
}
}
public class csSaveAndOpen : MonoBehaviour
{
public void OpenFile(String lURL, XMLFileType lType)
{
//The error is on next line
StartCoroutine(DownloadFile(lURL, lType));
}
IEnumerator DownloadFile(String lURL, XMLFileType lType)
{
//...
}
}
I can’t figure what the problem is.
The error message :
Thanks in advance for help