I’m trying the MeshSerializer package from the Unity Wiki and it’s failing because it’s trying to access data that hasn’t been downloaded yet.
Looking at the code I can see there should be a yield statement in there:
static function ReadMeshFromUrl( url : String ) : Mesh
{
var download = WWW(url);
yield download;
if( download.error )
{
print ("Error downloading mesh from " + url);
return null;
}
var data = download.data;
However when this is compiled I get a :
error BCE0101: The return type of a generator must be either ‘System.Collections.IEnumerable’ or ‘Object’.
My code matched the use of yield in the Unity documentation example - what am I doing wrong?