首次提交
This commit is contained in:
33
Assets/Scripts/Fishing/FixedLine.cs
Normal file
33
Assets/Scripts/Fishing/FixedLine.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public class FixedLine : MonoBehaviour
|
||||
{
|
||||
public Transform target;
|
||||
private Rigidbody _rigidbody;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_rigidbody = GetComponent<Rigidbody>();
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
FixLine();
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
FixLine();
|
||||
}
|
||||
|
||||
|
||||
private void FixLine()
|
||||
{
|
||||
if (!target) return;
|
||||
_rigidbody.MovePosition(target.position);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user