From 15afa2ada704a12f5c0d461735ba71d22c74bfef Mon Sep 17 00:00:00 2001 From: soupday <79094830+soupday@users.noreply.github.com> Date: Wed, 27 Jul 2022 00:03:44 +0100 Subject: [PATCH] 1.3.5 - --- Editor/ColliderManagerEditor.cs | 34 +++++++++++++++++++++++++++++---- Runtime/ColliderManager.cs | 6 +++--- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/Editor/ColliderManagerEditor.cs b/Editor/ColliderManagerEditor.cs index 525bb26..dd1a488 100644 --- a/Editor/ColliderManagerEditor.cs +++ b/Editor/ColliderManagerEditor.cs @@ -321,12 +321,38 @@ private void UpdateSymmetrical(SymmetricalUpdateType type) else if (boneName.Contains("_Hip")) { symName = boneName; - } - else if (name == "CC_Base_NeckTwist01_Capsule(1)") + } + + if (!string.IsNullOrEmpty(symName)) + { + foreach (ColliderSettings cs in colliderManager.settings) + { + if (cs != currentCollider && cs.name.StartsWith(symName)) + { + if (type == SymmetricalUpdateType.Update) + { + cs.MirrorX(currentCollider); + cs.Update(); + } + else if (type == SymmetricalUpdateType.Reset) + { + cs.Reset(); + } + else if (type == SymmetricalUpdateType.Fetch) + { + cs.FetchSettings(); + } + } + } + } + + symName = null; + + if (name == "CC_Base_NeckTwist01_Capsule(1)") { symName = "CC_Base_NeckTwist01_Capsule(2)"; } - else if (name == "CC_Base_NeckTwist01_Capsule(2)") + else if (name == "CC_Base_NeckTwist01_Capsule(2)") { symName = "CC_Base_NeckTwist01_Capsule(1)"; } @@ -339,7 +365,7 @@ private void UpdateSymmetrical(SymmetricalUpdateType type) { if (type == SymmetricalUpdateType.Update) { - cs.MirrorX(currentCollider); + cs.MirrorZ(currentCollider); cs.Update(); } else if (type == SymmetricalUpdateType.Reset) diff --git a/Runtime/ColliderManager.cs b/Runtime/ColliderManager.cs index d7c885d..afa4562 100644 --- a/Runtime/ColliderManager.cs +++ b/Runtime/ColliderManager.cs @@ -123,11 +123,11 @@ public void MirrorZ(ColliderSettings cs) { radiusAdjust = cs.radiusAdjust; heightAdjust = cs.heightAdjust; - xAdjust = cs.xAdjust; + xAdjust = -cs.xAdjust; yAdjust = cs.yAdjust; - zAdjust = -cs.zAdjust; + zAdjust = cs.zAdjust; xRotate = -cs.xRotate; - yRotate = cs.yRotate; + yRotate = -cs.yRotate; zRotate = cs.zRotate; }