line修改

This commit is contained in:
Bob.Song
2026-04-16 16:36:09 +08:00
parent 9681d7526f
commit f2803c9d74
11 changed files with 804 additions and 1072 deletions

View File

@@ -14,13 +14,13 @@ namespace NBF
Tail
}
private FLine _solver;
[SerializeField] private FLine _solver;
[Header("Node")] [SerializeField] private NodeType nodeType = NodeType.Tail;
[SerializeField] public Rigidbody body;
[SerializeField] private Rope _rope;
public Rope Rope;
[SerializeField] private MonoBehaviour interaction;
private ConfigurableJoint _joint;
[SerializeField] private ConfigurableJoint _joint;
[Header("Segment To Next Logical Node")] [Min(0f)] [SerializeField]
private float segmentLengthToNext = 0.5f;
@@ -63,8 +63,8 @@ namespace NBF
private void Awake()
{
_solver = GetComponentInParent<FLine>();
_joint = GetComponent<ConfigurableJoint>();
if (!_solver) _solver = GetComponentInParent<FLine>();
if (!_joint) _joint = GetComponent<ConfigurableJoint>();
EnsureFeatureCache();
}
@@ -97,7 +97,7 @@ namespace NBF
if (!Mathf.Approximately(lenght, _joint.linearLimit.limit))
{
_joint.linearLimit = new SoftJointLimit() { limit = lenght };
_rope.SetTargetLength(lenght - 0.1f);
Rope.SetTargetLength(lenght - 0.1f);
}
}