提交测试代码

This commit is contained in:
Bob.Song
2026-02-26 17:58:34 +08:00
parent be43dbbf46
commit 9a92e30a5f
94 changed files with 1925 additions and 2519 deletions

View File

@@ -17,7 +17,7 @@ namespace NBF
[SerializeField] private Rope bobberRope;
public LureController Lure;
public BobberController Bobber;
private float _groundSetting = 0.5f;
@@ -32,7 +32,6 @@ namespace NBF
protected override void OnInit()
{
var tipRb = Rod.Asset.LineConnectorRigidbody;
// startParticleAttachment.target = tipRb.transform;
if (isLureConnect)
{
Lure.SetJoint(tipRb);
@@ -48,7 +47,6 @@ namespace NBF
Lure.SetKinematic(false);
}
// onLureInit.Raise(lure.gameObject);
GetComponentsInChildren<Transform>(includeInactive: true).ToList().ForEach(delegate(Transform i)
{
i.gameObject.SetActive(true);
@@ -68,6 +66,40 @@ namespace NBF
// rodLine.GenerateLineRendererRope(guides.ToArray(), _LineThickness);
}
public void InitTest(Rigidbody tipRb)
{
if (isLureConnect)
{
Lure.SetJoint(tipRb);
Lure.EnableCollision(false);
}
else
{
fishingRope.startAnchor = tipRb;
Bobber.SetJoint(tipRb);
Lure.SetJoint(Bobber.rbody);
Lure.gameObject.SetActive(true);
Lure.EnableCollision(false);
Lure.SetKinematic(false);
}
GetComponentsInChildren<Transform>(includeInactive: true).ToList().ForEach(delegate(Transform i)
{
i.gameObject.SetActive(true);
});
StartCoroutine(LureUseGravity());
if (isLureConnect)
{
fishingRope.Init(Rod);
}
else
{
fishingRope.Init(Rod);
bobberRope.Init(Rod);
}
}
private IEnumerator LureUseGravity()
{
yield return 1;
@@ -89,7 +121,7 @@ namespace NBF
public void SetObiRopeStretch(float value)
{
Log.Error($"SetObiRopeStretch={value}");
fishingRope.SetTargetLength(value-0.2f);
fishingRope.SetTargetLength(value - 0.2f);
}
}
}