mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-13 22:09:53 -05:00
Merge pull request #1975 from HoloLabInc/arcsin16/fix-concurrent-access-error
ランタイムロードの非同期アクセスで例外が発生する問題の修正
This commit is contained in:
commit
d44fa6d308
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using UnityEngine;
|
||||
using System.IO;
|
||||
using UniJSON;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace UniGLTF
|
||||
{
|
||||
|
|
@ -135,7 +136,7 @@ namespace UniGLTF
|
|||
}
|
||||
}
|
||||
|
||||
static Dictionary<(string, int, int), bool> s_cache = new Dictionary<(string, int, int), bool>();
|
||||
static ConcurrentDictionary<(string, int, int), bool> s_cache = new ConcurrentDictionary<(string, int, int), bool>();
|
||||
|
||||
public static bool IsGeneratedUniGLTFAndOlder(this glTF gltf, int major, int minor)
|
||||
{
|
||||
|
|
@ -149,7 +150,7 @@ namespace UniGLTF
|
|||
}
|
||||
|
||||
var result = IsGeneratedUniGLTFAndOlderThan(gltf.asset.generator, major, minor);
|
||||
s_cache.Add(key, result);
|
||||
s_cache[key] = result;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user