Skip to content

Commit a1ce9e7

Browse files
committed
Merge branch 'release/v1.4.3' of github.com:mapbox/mapbox-unity-sdk into release/v1.4.3
* 'release/v1.4.3' of github.com:mapbox/mapbox-unity-sdk: Refactor ambient file caching to be compatible with 4.6 runtime (#825)
2 parents 63a7b8f + b542503 commit a1ce9e7

25 files changed

+909
-681
lines changed

documentation/docs/05-changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
##### Bug Fixes
1515
- Fix issue with UvModifier which caused wrong roof uv positions calculations.
1616
- Fix issue with data fetcher to handle failed connections properly, which caused IndexOutOfRangeException during tile loading/unloading.
17+
- Fix issue with ambient file caching on Windows with .NET4.6 runtime and long file names. https://github.com/mapbox/mapbox-unity-sdk/pull/825 https://github.com/mapbox/mapbox-unity-sdk/issues/815
1718
##### Known Issues
1819
- ARInterface related errors and crashes on Unity 2018.1.1f1 related to bug in Unity https://issuetracker.unity3d.com/issues/vuforia-gameobject-transforms-are-not-being-disabled-when-the-player-is-stopped
1920

sdkproject/Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/CachingWebFileSource.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ public void Clear()
100100
}
101101

102102

103+
public void ReInit() {
104+
foreach (var cache in _caches)
105+
{
106+
cache.ReInit();
107+
}
108+
}
109+
110+
103111
public IAsyncRequest Request(
104112
string uri
105113
, Action<Response> callback

sdkproject/Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/ICache.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public interface ICache
1414
/// </summary>
1515
uint MaxCacheSize { get; }
1616

17+
1718
/// <summary>
1819
/// Add tile data to the cache
1920
/// </summary>
@@ -42,5 +43,11 @@ public interface ICache
4243
/// </summary>
4344
/// <param name="mapId"></param>
4445
void Clear(string mapId);
46+
47+
48+
/// <summary>
49+
/// Reinitialize cache. Might be needed after 'Clear', eg for SQLiteCache
50+
/// </summary>
51+
void ReInit();
4552
}
46-
}
53+
}

sdkproject/Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/MbTilesCache.cs

Lines changed: 0 additions & 195 deletions
This file was deleted.

sdkproject/Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/MemoryCache.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ public uint MaxCacheSize
3737
}
3838

3939

40+
public void ReInit()
41+
{
42+
_cachedResponses = new Dictionary<string, CacheItem>();
43+
}
44+
45+
4046
public void Add(string mapdId, CanonicalTileId tileId, CacheItem item, bool forceInsert)
4147
{
4248
string key = mapdId + "||" + tileId;

0 commit comments

Comments
 (0)