private void LoadImages()
string pathPrefix = @"file://";
string pathImageAssets = @"C:\Assets\Pictures\";
string pathSmall = @"small\";
string filename = @"1";
string fileSuffix = @".jpg";
for (int=0; i<2; i++);
{
string indexSuffix = "";
float logIdx = Mathf.Log10(i+1);
if (ligIdx < 1.0)
indexSuffix += "00";
else if (logIdx < 2.0)
indexSuffix += "0";
indexSuffix += (i+1);
string fullFilename = pathPrefic +pathImageAssets + pathSmall + filename
WWW www = new WWW(fullFilename)
Texture2D texTmp = new Texture2D(320, 320, TextureFormat.DXT1, false)
www.LoadImageIntoTexture(texTmp);
imageBuffer.Add(texTmp);
}
It says there’s a parsing error at (3,6)
I want to cleare it to test if it works. And I don’t want to load into a texture, rather to a spec. place on the screen, how shall I rewrite?
It’s enough to answer just my first question, I will find out the rest
But your help would be appreciated.
1 Answer
1
CS8025 is a parsing error, meaning that your syntax is incorrect. This can always be equated to a mistake when writing the code (as opposed to a runtime error). In you’re case, you’re missing some curly braces. Here is Fixed code:
private void LoadImages()
{ // <-------------------------Missing Curly
string pathPrefix = @"file://";
string pathImageAssets = @"C:\Assets\Pictures\";
string pathSmall = @"small\";
string filename = @"1";
string fileSuffix = @".jpg";
for (int=0; i<2; i++);
{
string indexSuffix = "";
float logIdx = Mathf.Log10(i+1);
if (ligIdx < 1.0)
{ //<--------------------missing curly (though, optional)
indexSuffix += "00";
} //<--------------------missing curly
else if (logIdx < 2.0)
{ //<--------------------missing curly
indexSuffix += "0";
indexSuffix += (i+1);
} //<--------------------missing curly
} //<--------------------missing curly (ends for loop)
string fullFilename = pathPrefic +pathImageAssets + pathSmall + filename
WWW www = new WWW(fullFilename)
Texture2D texTmp = new Texture2D(320, 320, TextureFormat.DXT1, false)
www.LoadImageIntoTexture(texTmp);
imageBuffer.Add(texTmp);
}
My suggestion is to format your code better using indentation on scope changes so that you can easily spot these errors.
i.e:
private void LoadImages()
{ // <-------------------------Missing Curly
string pathPrefix = @"file://";
string pathImageAssets = @"C:\Assets\Pictures\";
string pathSmall = @"small\";
string filename = @"1";
string fileSuffix = @".jpg";
for (int=0; i<2; i++);
{
string indexSuffix = "";
float logIdx = Mathf.Log10(i+1);
if (ligIdx < 1.0)
{ //<--------------------missing curly (though, optional)
indexSuffix += "00";
} //<--------------------missing curly
else if (logIdx < 2.0)
{ //<--------------------missing curly
indexSuffix += "0";
indexSuffix += (i+1);
} //<--------------------missing curly
} //<--------------------missing curly (ends for loop)
string fullFilename = pathPrefic +pathImageAssets + pathSmall + filename
WWW www = new WWW(fullFilename)
Texture2D texTmp = new Texture2D(320, 320, TextureFormat.DXT1, false)
www.LoadImageIntoTexture(texTmp);
imageBuffer.Add(texTmp);
}
I tried to write that a lot of places. Where do you exactly think I should write it?
– DraghouYeah, thanks :)
– Draghou