mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
fix: error when multiple gameobjects have the same path (#957)
This commit is contained in:
parent
c2f37bb3a1
commit
1c766e9fe8
@ -308,8 +308,13 @@ namespace nadena.dev.modular_avatar.animation
|
||||
{
|
||||
if (_pathToObject == null)
|
||||
{
|
||||
_pathToObject = _objectToOriginalPaths.SelectMany(kvp => kvp.Value.Select(p => (p, kvp.Key)))
|
||||
.ToImmutableDictionary(t => t.p, t => t.Key);
|
||||
var builder = ImmutableDictionary.CreateBuilder<string, GameObject>();
|
||||
|
||||
foreach (var kvp in _objectToOriginalPaths)
|
||||
foreach (var p in kvp.Value)
|
||||
builder[p] = kvp.Key;
|
||||
|
||||
_pathToObject = builder.ToImmutable();
|
||||
}
|
||||
|
||||
if (_pathToObject.TryGetValue(path, out var obj))
|
||||
|
Loading…
Reference in New Issue
Block a user