重新导入obi

This commit is contained in:
2026-04-06 11:35:18 +08:00
parent 05fa2d6e5e
commit ae3002a0e2
1643 changed files with 232496 additions and 13 deletions

View File

@@ -0,0 +1,36 @@
using Obi;
using UnityEngine;
namespace NBF
{
/// <summary>
/// 基于obi rope的鱼线控制脚本
/// </summary>
public class RopeByObi : RopeBase
{
[SerializeField] private ObiRope rope;
[SerializeField] private ObiRopeCursor cursor;
[SerializeField] private float percentageElasticity = 0.2f;
private float _stretchScale;
private void Awake()
{
rope = GetComponent<ObiRope>();
}
private void Update()
{
rope.stretchingScale = _stretchScale;
}
protected override void OnSetLineLength(float length)
{
cursor = ((cursor == null) ? GetComponent<ObiRopeCursor>() : cursor);
_stretchScale = Mathf.Clamp(length - percentageElasticity, 0f, float.PositiveInfinity);
}
}
}