Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoooi0 committed Feb 20, 2022
1 parent e0e4db0 commit 51f5b55
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/MotionSource/AbstractFemaleMotionSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ private bool UpdateHandTarget(string side)
{
var carpal = _femaleAtom.GetRigidBodyByName($"{side}Carpal2");
var fingerBase = carpal?.GetComponentByName<CapsuleCollider>("_Collider3");
var fingerTip = _femaleAtom.GetRigidBodyByName($"{side}Pinky3").GetComponentInChildren<CapsuleCollider>();
var fingerTip = _femaleAtom.GetRigidBodyByName($"{side}Pinky3")?.GetComponentInChildren<CapsuleCollider>();

if (carpal == null || fingerBase == null || fingerTip == null)
return false;
Expand Down Expand Up @@ -272,9 +272,9 @@ private bool UpdateHandTarget(string side)

private bool UpdateChestTarget()
{
var left = _femaleAtom.GetComponentByName<AutoCollider>("AutoColliderFemaleAutoColliderslNipple1").jointCollider as CapsuleCollider;
var right = _femaleAtom.GetComponentByName<AutoCollider>("AutoColliderFemaleAutoCollidersrNipple1").jointCollider as CapsuleCollider;
var chest = _femaleAtom.GetComponentByName<AutoCollider>("AutoColliderFemaleAutoColliderschest2c").jointCollider as CapsuleCollider;
var left = _femaleAtom.GetComponentByName<AutoCollider>("AutoColliderFemaleAutoColliderslNipple1")?.jointCollider as CapsuleCollider;
var right = _femaleAtom.GetComponentByName<AutoCollider>("AutoColliderFemaleAutoCollidersrNipple1")?.jointCollider as CapsuleCollider;
var chest = _femaleAtom.GetComponentByName<AutoCollider>("AutoColliderFemaleAutoColliderschest2c")?.jointCollider as CapsuleCollider;

if (left == null || right == null || chest == null)
return false;
Expand All @@ -298,10 +298,9 @@ private bool UpdateChestTarget()

private bool UpdateFootTarget(string side)
{
var foot = _femaleAtom.GetRigidBodyByName($"{side}Foot");
var footBase = foot?.GetComponentByName<CapsuleCollider>("_Collider6");
var footBase = _femaleAtom.GetRigidBodyByName($"{side}Foot")?.GetComponentByName<CapsuleCollider>("_Collider6");

if (foot == null || footBase == null)
if (footBase == null)
return false;

_targetRight = footBase.transform.forward;
Expand All @@ -319,12 +318,10 @@ private bool UpdateFootTarget(string side)

private bool UpdateFeetTarget()
{
var leftFoot = _femaleAtom.GetRigidBodyByName("lFoot");
var rightFoot = _femaleAtom.GetRigidBodyByName("rFoot");
var leftFootBase = leftFoot?.GetComponentByName<CapsuleCollider>("_Collider6");
var rightFootBase = rightFoot?.GetComponentByName<CapsuleCollider>("_Collider6");
var leftFootBase = _femaleAtom.GetRigidBodyByName("lFoot")?.GetComponentByName<CapsuleCollider>("_Collider6");
var rightFootBase = _femaleAtom.GetRigidBodyByName("rFoot")?.GetComponentByName<CapsuleCollider>("_Collider6");

if (leftFoot == null || rightFoot == null || leftFootBase == null || rightFootBase == null)
if (leftFootBase == null || rightFootBase == null)
return false;

var leftPosition = leftFootBase.transform.position - leftFootBase.transform.up * leftFootBase.radius;
Expand Down

0 comments on commit 51f5b55

Please sign in to comment.