39 lines
773 B
C#
39 lines
773 B
C#
using UnityEngine;
|
|
|
|
namespace NBF
|
|
{
|
|
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)
|
|
{
|
|
}
|
|
}
|
|
} |