修改线脚本
This commit is contained in:
@@ -284,6 +284,24 @@ public class Rope : MonoBehaviour
|
||||
|
||||
return totalLength;
|
||||
}
|
||||
|
||||
public float GetPhysicsPolylineLength()
|
||||
{
|
||||
float total = 0f;
|
||||
for (int i = 1; i < _physicsNodes; i++)
|
||||
total += Vector3.Distance(_pCurr[i - 1], _pCurr[i]);
|
||||
return total;
|
||||
}
|
||||
|
||||
public void DebugLength()
|
||||
{
|
||||
Debug.Log(
|
||||
$"current={_currentLength}, target={_targetLength}, nodes={_physicsNodes}, " +
|
||||
$"seg={physicsSegmentLen}, head={_headRestLen}, headMin={headMinLen}, " +
|
||||
$"solverRestTotal={(_physicsNodes - 2) * physicsSegmentLen + _headRestLen}, " +
|
||||
$"poly={GetPhysicsPolylineLength()}"
|
||||
);
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user