阶段性完成
This commit is contained in:
@@ -26,6 +26,11 @@ namespace Cielonos.MainGame.FunctionalAnimation
|
||||
|
||||
bool Adsorption()
|
||||
{
|
||||
if (target == null || executor == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Vector3 centerPointPosition = executor.flexibleCenterPoint.position;
|
||||
Vector3 adsorptionVector;
|
||||
|
||||
@@ -35,7 +40,11 @@ namespace Cielonos.MainGame.FunctionalAnimation
|
||||
}
|
||||
else*/
|
||||
{
|
||||
adsorptionVector = target.flexibleCenterPoint.position - centerPointPosition;
|
||||
float targetRadius = target.collisionSc.useCharacterController
|
||||
? target.collisionSc.characterController.radius
|
||||
: target.collisionSc.mainColliderRadius;
|
||||
Vector3 adsorptionDirection = (target.flexibleCenterPoint.position - centerPointPosition).normalized;
|
||||
adsorptionVector = (target.flexibleCenterPoint.position - adsorptionDirection * targetRadius) - centerPointPosition;
|
||||
adsorptionVector *= (adsorptionVector.magnitude - (enableMinDistance * 0.5f)) / adsorptionVector.magnitude;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user