Hi at all. Strange issue happen.
**I've implemented a small call WebRequest to Api DropBox** ([check here the final solution i've found][1])
[1]: https://answers.unity.com/questions/1796779/dropbox-https-api-request-what-should-i-do.html
Now I'm in trouble with a strange issue : **I've declared a List . But after returning from WebRequest (it is in another Script) suddenly List.Count become = 0.** I've checked carefully all calls, but in noways this "List" is touched... but it will lost after WebRequest. Not sure but I'm believe **that I should find a "way" to keep it in memory (but don't know how).**
private void Loader()
{
// Copy a Photo List from Shared Variables
for (int i = 0; i< VideoGames_SharedVar.PhotoList.Count; i++)
{
PhotoListDropBox.Add(VideoGames_SharedVar.PhotoList[i]);
}
// Path per DropBox
DropBoxImagePath = "";
DropBoxLoadDone=false;
}
private IEnumerator ImageParse()
{
DropBoxFullLoad=false;
// Go Thru all Images
for (int i = 0; i < PhotoListDropBox.Count; i++)
{
// Processing Url for WebRequest
string[] StringArray = PhotoListDropBox[i].Split(new string[] {"\\"}, StringSplitOptions.None);
DropBoxImagePath = StringArray[StringArray.Length-1];
DropBoxImagePath = "/Shared Folder/" + DropBoxImagePath;
// Call WebRequest on another script
WebRequestScript.PressMe();
// Wait until loading from Webrequest is done (list count is OK)
while (DropBoxLoadDone==false)
{
yield return null;
};
// HERE MY LIST BECAME ZERO
string TempString = CercaSharedURL();
PhotoListDropBox[i] = TempString;
// Above error is generated because PhotoListDropBox is null
}
DropBoxFullLoad=true;
↧