diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs index 51b59d0ea..c41e983fe 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/Util/CachedEnum/CachedEnumType.cs @@ -25,6 +25,7 @@ namespace UniGLTF public static T Parse(string name, bool ignoreCase) { var caches = ignoreCase ? _ignoreCaseValues : _values; + if (caches.TryGetValue(name, out var ignoreCaseValue)) { return ignoreCaseValue; @@ -32,7 +33,7 @@ namespace UniGLTF if (Enum.TryParse(name, ignoreCase, out var result)) { - _values.Add(name, result); + caches.Add(name, result); return result; }