I am working on a project in Unity3d and I was writing some code and initially I had the IEnumerator as Start instead of RunThis and the code ran fine, now I went to move it in to a new method and it didn't do anything. Could Someone explain this?
using UnityEngine;
using System.Collections;
public class UniDLC : MonoBehaviour
{
void Start() {
RunThis();
}
IEnumerator RunThis()
{
Debug.Log("ran");
string url = "file://C:\\Users\\tom\\Documents\\test.txt";
WWW www = new WWW(url);
yield return www;
Debug.Log(www.text);
}
}
P.s. I anticipate at least someone telling me about unityanswers, yes I know it exists but the site bugs out too much and I am sure someone hear can answer this, thank you.