sava
This commit is contained in:
@@ -5,10 +5,14 @@ namespace NBF
|
||||
{
|
||||
public class FLine : FGearBase
|
||||
{
|
||||
public ObiSolver Solver;
|
||||
[SerializeField] private ObiParticleAttachment startParticleAttachment;
|
||||
[SerializeField] private bool isLureConnect;
|
||||
[SerializeField] private RodLine rodLine;
|
||||
[SerializeField] private Rope fishingRope;
|
||||
[SerializeField] private Rope bobberRope;
|
||||
public Transform LureRoot;
|
||||
public Transform BobberRoot;
|
||||
|
||||
public float LineLength = 0.5f;
|
||||
|
||||
@@ -20,6 +24,26 @@ namespace NBF
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
var rodTip = Rod.Asset.lineConnector;
|
||||
startParticleAttachment.target = rodTip;
|
||||
Solver = transform.parent.GetComponent<ObiSolver>();
|
||||
rodLine.gameObject.SetActive(false);
|
||||
var rodType = (ItemSubType)Rod.ItemInfo.Config.Type;
|
||||
if (rodType == ItemSubType.RodSpine || rodType == ItemSubType.RodBolo)
|
||||
{
|
||||
rodLine.gameObject.SetActive(true);
|
||||
}
|
||||
else if (rodType == ItemSubType.RodTele)
|
||||
{
|
||||
bobberRope.gameObject.SetActive(true);
|
||||
BobberRoot.gameObject.SetActive(true);
|
||||
var bobberConfigurableJoint = BobberRoot.GetComponent<ConfigurableJoint>();
|
||||
bobberConfigurableJoint.connectedBody = Rod.Asset.LineConnectorRigidbody;;
|
||||
}
|
||||
|
||||
LureRoot.gameObject.SetActive(true);
|
||||
fishingRope.gameObject.SetActive(true);
|
||||
// SceneSettings.Instance.obiFixedUpdater.solvers.Add(Solver);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user