线缆的物理表现

This commit is contained in:
2024-08-28 17:04:13 +08:00
parent a82b020c48
commit 5831a7cf84
17 changed files with 864 additions and 108 deletions
@@ -23,14 +23,14 @@ public class VisualLineSegment : MonoBehaviour
lineRenderer.SetPosition(1, EndPoint);
}
public void ShrinkAndDisappear()
{
// Shrink the line segment from the end to the start
DOTween.To(() => EndPoint, x => EndPoint = x, StartPoint, 1f)
.OnUpdate(() => {
lineRenderer.SetPosition(0, StartPoint);
lineRenderer.SetPosition(1, EndPoint);
})
.OnComplete(() => Destroy(gameObject));
}
// public void ShrinkAndDisappear()
// {
// // Shrink the line segment from the end to the start
// DOTween.To(() => EndPoint, x => EndPoint = x, StartPoint, 1f)
// .OnUpdate(() => {
// lineRenderer.SetPosition(0, StartPoint);
// lineRenderer.SetPosition(1, EndPoint);
// })
// .OnComplete(() => Destroy(gameObject));
// }
}