升级obi
This commit is contained in:
@@ -43,14 +43,13 @@ public class RodLine : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < points.Length; i++)
|
||||
for (var i = 0; i < points.Length; i++)
|
||||
{
|
||||
Transform transform = points[i];
|
||||
if ((bool)transform)
|
||||
var point = points[i];
|
||||
if (point)
|
||||
{
|
||||
lineRenderer.SetPosition(i, transform.position);
|
||||
lineRenderer.SetPosition(i, point.position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using UnityEngine;
|
||||
public class Rope : MonoBehaviour
|
||||
{
|
||||
private FRod _rod;
|
||||
public bool isFloatRope;
|
||||
[SerializeField] private ObiRope rope;
|
||||
|
||||
[SerializeField] private ObiRopeCursor cursor;
|
||||
@@ -16,9 +17,21 @@ public class Rope : MonoBehaviour
|
||||
private void Awake()
|
||||
{
|
||||
rope = GetComponent<ObiRope>();
|
||||
}
|
||||
|
||||
public void Init(FRod rod)
|
||||
{
|
||||
_rod = rod;
|
||||
if (_rod)
|
||||
{
|
||||
LineLength_OnValueChanged(_rod.lineLength);
|
||||
if (isFloatRope)
|
||||
{
|
||||
LineLength_OnValueChanged(_rod.floatLength);
|
||||
}
|
||||
else
|
||||
{
|
||||
LineLength_OnValueChanged(_rod.lineLength - _rod.floatLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user