mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-03-09 15:24:58 +08:00
Don't remap references to the animator itself
This commit is contained in:
parent
757eaa9a85
commit
5b52ad45c1
@ -93,6 +93,18 @@ namespace net.fushizen.modular_avatar.core.editor
|
||||
return asm;
|
||||
}
|
||||
|
||||
private static string MapPath(EditorCurveBinding binding, string basePath)
|
||||
{
|
||||
if (binding.type == typeof(Animator) && binding.path == "")
|
||||
{
|
||||
return "";
|
||||
}
|
||||
else
|
||||
{
|
||||
return PathMappings.MapPath(basePath + binding.path);
|
||||
}
|
||||
}
|
||||
|
||||
private Object customClone(Object o, string basePath)
|
||||
{
|
||||
if (basePath == "") return null;
|
||||
@ -106,7 +118,7 @@ namespace net.fushizen.modular_avatar.core.editor
|
||||
foreach (var binding in AnimationUtility.GetCurveBindings(clip))
|
||||
{
|
||||
var newBinding = binding;
|
||||
newBinding.path = PathMappings.MapPath(basePath + binding.path);
|
||||
newBinding.path = MapPath(binding, basePath);
|
||||
newClip.SetCurve(newBinding.path, newBinding.type, newBinding.propertyName,
|
||||
AnimationUtility.GetEditorCurve(clip, binding));
|
||||
}
|
||||
@ -114,7 +126,7 @@ namespace net.fushizen.modular_avatar.core.editor
|
||||
foreach (var objBinding in AnimationUtility.GetObjectReferenceCurveBindings(clip))
|
||||
{
|
||||
var newBinding = objBinding;
|
||||
newBinding.path = PathMappings.MapPath(basePath + objBinding.path);
|
||||
newBinding.path = MapPath(objBinding, basePath);
|
||||
AnimationUtility.SetObjectReferenceCurve(newClip, newBinding,
|
||||
AnimationUtility.GetObjectReferenceCurve(clip, objBinding));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user