升级obi
This commit is contained in:
19
Assets/Scripts/Fishing/BobberController.cs
Normal file
19
Assets/Scripts/Fishing/BobberController.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBF
|
||||
{
|
||||
public class BobberController : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Rigidbody _rbody;
|
||||
|
||||
[SerializeField] private ConfigurableJoint joint;
|
||||
|
||||
public Rigidbody rbody => _rbody;
|
||||
|
||||
public void SetJoint(Rigidbody rb)
|
||||
{
|
||||
joint = joint == null ? GetComponent<ConfigurableJoint>() : joint;
|
||||
joint.connectedBody = rb;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user