You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
info.Tile.AddLog(Time.frameCount+" Enqueued for fetching");
49
-
_tileOrder.Enqueue(key);
50
-
info.QueueTime=Time.time;
51
-
_tileFetchInfos.Add(key,info);
52
-
}
53
-
else
54
-
{
55
-
//same requests is already in queue.
56
-
//this probably means first one was supposed to be cancelled but for some reason has not.
57
-
//ensure all data fetchers (including unorthodox ones like file data fetcher) handling
58
-
//tile cancelling properly
59
-
#if DEPLOY_DEV||UNITY_EDITOR
60
-
Debug.Log("tile request is already in queue. This most likely means first request was supposed to be cancelled but not. "+info.Tile.Id+" "+info.Tile.TilesetId);
61
-
#endif
62
-
}
51
+
info.QueueTime=Time.time;
52
+
_fetchQueue.Enqueue(info);
63
53
}
64
54
55
+
publicvirtualTileJSONGetTileJSON(inttimeout=10)
56
+
{
57
+
returnnewTileJSON(_fileSource,timeout);
58
+
}
59
+
60
+
publicvoidOnDestroy()
61
+
{
62
+
_isDestroying=true;
63
+
_fetchQueue.Clear();
64
+
_fetchQueue=null;
65
+
_fileSource.OnDestroy();
66
+
_fileSource=null;
67
+
}
68
+
65
69
privateIEnumeratorUpdateTick()
66
70
{
67
71
while(!_isDestroying)
68
72
{
69
-
varfallbackCounter=0;
70
-
while(_tileOrder.Count>0&&
71
-
_globalActiveRequests.Count<_activeRequestLimit&&
72
-
fallbackCounter<_activeRequestLimit)
73
+
while(_fetchQueue.Count>0&&
74
+
_globalActiveRequests.Count<_activeRequestLimit)
73
75
{
74
-
fallbackCounter++;
75
-
vartileKey=_tileOrder.Peek();//we just peek first as we might want to hold it until delay timer runs out
76
-
if(!_tileFetchInfos.ContainsKey(tileKey))
76
+
varinfo=_fetchQueue.Peek();//we just peek first as we might want to hold it until delay timer runs out
0 commit comments