Skip to content

Commit

Permalink
Merge pull request #20 from soupday/dev
Browse files Browse the repository at this point in the history
1.3.5
  • Loading branch information
soupday authored Jul 26, 2022
2 parents cbcc98b + 15afa2a commit c6c2dc2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
34 changes: 30 additions & 4 deletions Editor/ColliderManagerEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)";
}
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions Runtime/ColliderManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit c6c2dc2

Please sign in to comment.