diff --git a/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs b/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs index 6f4374687..b4c6417eb 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/RuntimeGltfInstance.cs @@ -255,9 +255,10 @@ namespace UniGLTF } } - static Dictionary> PoseMap = new(); + static readonly Dictionary> PoseMap = new(); + public static IReadOnlyDictionary SafeGetInitialPose( - Transform root, bool useCache = true) + Transform root, bool useCache = false) { if (useCache && PoseMap.TryGetValue(root, out var pose)) { @@ -278,7 +279,10 @@ namespace UniGLTF } // add cache - PoseMap.Add(root, pose); + if (useCache) + { + PoseMap.Add(root, pose); + } return pose; }