The following coroutine runs and successfully adds image files to a List. However, no methods are called after running the coroutine.
void Start()
{
CreateMap(10, 10);
SetTexturePaths();
GetFileNamesFromPaths();
StartCoroutine(GetTextures());
DisplayGameTileTextures();
}
IEnumerator GetTextures() // Coroutine.
{
foreach(string fileName in _gameTileTexturesFileNames)
{
string filePath = _gameTileTexturesPath + fileName;
Debug.Log("filePath: " + filePath);
Byte[] byteFile = File.ReadAllBytes(filePath);
Tex = new Texture2D(256, 256);
yield return Tex.LoadImage(byteFile);
Tex.Apply();
_gameTileTextures.Add(Tex);
}
yield break;
}
Do I need to somehow stop the coroutine? Or is it a different issue?