# Conflicts:
#	Assets/Scenes/BobberTest.unity
#	UserSettings/EditorUserSettings.asset
This commit is contained in:
Bob.Song
2026-03-06 12:16:31 +08:00
283 changed files with 3044 additions and 12634 deletions

View File

@@ -235,6 +235,27 @@ public class Rope : MonoBehaviour
public void SetTargetLength(float lengthMeters) => _targetLength = Mathf.Max(0f, lengthMeters);
public float GetCurrentLength() => _currentLength;
public float GetTargetLength() => _targetLength;
public float GetLengthSmoothVel() => _lengthSmoothVel;
public float GetLengthByPoints()
{
if (_rPoints == null || _lineRenderer == null) return 0f;
int count = _lineRenderer.positionCount;
if (count < 2) return 0f;
float totalLength = 0f;
for (int i = 1; i < count; i++)
{
Vector3 a = _rPoints[i - 1];
Vector3 b = _rPoints[i];
totalLength += Vector3.Distance(a, b);
}
return totalLength;
}
private void FixedUpdate()
{

View File

@@ -9,6 +9,8 @@ namespace NBF
// transform.position = Rod.lineHandler.LineConnector_1.transform.position;
SetParent(Rod.Line.Bobber.transform);
transform.localPosition = Vector3.zero;
var buoyancy = GetComponentInParent<CapsuleBuoyancyStable>();
buoyancy.InitBobber();
}
}
}

View File

@@ -121,7 +121,7 @@ namespace NBF
public void SetObiRopeStretch(float value)
{
Log.Error($"SetObiRopeStretch={value}");
fishingRope.SetTargetLength(value - 0.2f);
fishingRope.SetTargetLength(value);
}
}
}