提交修改
This commit is contained in:
@@ -26,12 +26,12 @@ namespace NBF
|
||||
/// <summary>
|
||||
/// 主线
|
||||
/// </summary>
|
||||
[SerializeField] private Rope fishingRope;
|
||||
[SerializeField] private RopeBase fishingRope;
|
||||
|
||||
/// <summary>
|
||||
/// 浮漂和鱼钩线
|
||||
/// </summary>
|
||||
[SerializeField] private Rope bobberRope;
|
||||
[SerializeField] private RopeBase bobberRope;
|
||||
|
||||
public LureController Lure;
|
||||
public BobberController Bobber;
|
||||
@@ -129,13 +129,13 @@ namespace NBF
|
||||
// value -= 0.2f;
|
||||
}
|
||||
|
||||
fishingRope.SetTargetLength(value);
|
||||
fishingRope.SetLineLength(value);
|
||||
}
|
||||
|
||||
public void SetLureLength(float value)
|
||||
{
|
||||
Log.Error($"SetObiRopeStretch={value}");
|
||||
bobberRope.SetTargetLength(value);
|
||||
bobberRope.SetLineLength(value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
/// <summary>
|
||||
/// 鱼线脚本
|
||||
/// </summary>
|
||||
public interface IRope
|
||||
{
|
||||
void SetLineLength(float length);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e702dc5afb0a467e9e01a920d959a977
|
||||
timeCreated: 1775445873
|
||||
@@ -2,21 +2,38 @@
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public abstract class RopeBase : MonoBehaviour, IRope
|
||||
public abstract class RopeBase : MonoBehaviour
|
||||
{
|
||||
[Header("Anchors")] [SerializeField] public Rigidbody startAnchor;
|
||||
[SerializeField] public Rigidbody endAnchor;
|
||||
|
||||
public float CurrentLength { get; protected set; }
|
||||
|
||||
|
||||
protected FRod Rod;
|
||||
|
||||
public void Init(FRod rod)
|
||||
{
|
||||
Rod = rod;
|
||||
OnInit();
|
||||
}
|
||||
|
||||
public void SetLineLength(float length)
|
||||
{
|
||||
CurrentLength = length;
|
||||
}
|
||||
|
||||
public float GetCurrentLength()
|
||||
{
|
||||
return CurrentLength;
|
||||
}
|
||||
|
||||
protected virtual void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual void OnSetLineLength(float length)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,7 @@ namespace NBF
|
||||
[SerializeField] private ObiRopeCursor cursor;
|
||||
|
||||
[SerializeField] private float percentageElasticity = 0.2f;
|
||||
|
||||
|
||||
|
||||
private float _stretchScale;
|
||||
|
||||
private void Awake()
|
||||
|
||||
Reference in New Issue
Block a user