43 lines
964 B
C#
43 lines
964 B
C#
using UnityEngine;
|
|
|
|
public class Feeder : MonoBehaviour
|
|
{
|
|
[HideInInspector]
|
|
public Rigidbody linkConnectorUp;
|
|
|
|
public HingeJoint hingeJointUp;
|
|
|
|
[HideInInspector]
|
|
public FishingLine currentFishingLine;
|
|
|
|
[HideInInspector]
|
|
public Rigidbody rigidbody;
|
|
|
|
[HideInInspector]
|
|
public WaterDisplacementObject waterDisplacementObject;
|
|
|
|
private void Start()
|
|
{
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
}
|
|
|
|
public void Link(Rigidbody connector)
|
|
{
|
|
if (connector.transform.parent.GetComponent<LineHandler>().lineType == LineHandler.LineType.ThereSegment)
|
|
{
|
|
currentFishingLine = connector.transform.parent.GetComponent<LineHandler>().currentRodFishingLineComponent;
|
|
if (!(currentFishingLine.feeder != this))
|
|
{
|
|
currentFishingLine.feeder = this;
|
|
linkConnectorUp = connector;
|
|
base.transform.position = linkConnectorUp.position;
|
|
hingeJointUp.connectedBody = linkConnectorUp;
|
|
linkConnectorUp.GetComponent<MeshRenderer>().enabled = false;
|
|
}
|
|
}
|
|
}
|
|
}
|