mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-05-19 17:49:01 +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;
|
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)
|
private Object customClone(Object o, string basePath)
|
||||||
{
|
{
|
||||||
if (basePath == "") return null;
|
if (basePath == "") return null;
|
||||||
@ -106,7 +118,7 @@ namespace net.fushizen.modular_avatar.core.editor
|
|||||||
foreach (var binding in AnimationUtility.GetCurveBindings(clip))
|
foreach (var binding in AnimationUtility.GetCurveBindings(clip))
|
||||||
{
|
{
|
||||||
var newBinding = binding;
|
var newBinding = binding;
|
||||||
newBinding.path = PathMappings.MapPath(basePath + binding.path);
|
newBinding.path = MapPath(binding, basePath);
|
||||||
newClip.SetCurve(newBinding.path, newBinding.type, newBinding.propertyName,
|
newClip.SetCurve(newBinding.path, newBinding.type, newBinding.propertyName,
|
||||||
AnimationUtility.GetEditorCurve(clip, binding));
|
AnimationUtility.GetEditorCurve(clip, binding));
|
||||||
}
|
}
|
||||||
@ -114,7 +126,7 @@ namespace net.fushizen.modular_avatar.core.editor
|
|||||||
foreach (var objBinding in AnimationUtility.GetObjectReferenceCurveBindings(clip))
|
foreach (var objBinding in AnimationUtility.GetObjectReferenceCurveBindings(clip))
|
||||||
{
|
{
|
||||||
var newBinding = objBinding;
|
var newBinding = objBinding;
|
||||||
newBinding.path = PathMappings.MapPath(basePath + objBinding.path);
|
newBinding.path = MapPath(objBinding, basePath);
|
||||||
AnimationUtility.SetObjectReferenceCurve(newClip, newBinding,
|
AnimationUtility.SetObjectReferenceCurve(newClip, newBinding,
|
||||||
AnimationUtility.GetObjectReferenceCurve(clip, objBinding));
|
AnimationUtility.GetObjectReferenceCurve(clip, objBinding));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user