Skip to content

Commit 1999b5a

Browse files
author
Dogukan Erenel
committed
* Added IsCached feature to DataCache class
1 parent 4cdb69f commit 1999b5a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Scripts/Utilities/DataCache.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,24 @@ public byte[] Find(string id)
129129
return null;
130130
}
131131

132+
public bool IsCached(string id)
133+
{
134+
bool isCached = false;
135+
136+
if(!string.IsNullOrEmpty(id))
137+
{
138+
id = id.Replace('/', '_');
139+
140+
CacheItem item = null;
141+
if (m_Cache.TryGetValue(id, out item))
142+
{
143+
isCached = File.Exists(item.Path);
144+
}
145+
}
146+
147+
return isCached;
148+
}
149+
132150
/// <summary>
133151
/// Save data into the cache by ID.
134152
/// </summary>

0 commit comments

Comments
 (0)