提交修改
This commit is contained in:
@@ -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