19 lines
614 B
C#
19 lines
614 B
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace RealityReboot.jelycho.game {
|
|
public class GutRenderer : MonoBehaviour {
|
|
static readonly List<Vector3> s_worldPositions = new(1024);
|
|
|
|
[SerializeField] Rope m_Rope;
|
|
[SerializeField] LineRenderer m_LineRenderer;
|
|
|
|
void Update() {
|
|
m_Rope.GetWorldPositions(s_worldPositions);
|
|
m_LineRenderer.positionCount = s_worldPositions.Count;
|
|
for (int i = 0; i < s_worldPositions.Count; i++) {
|
|
m_LineRenderer.SetPosition(i, s_worldPositions[i]);
|
|
}
|
|
}
|
|
}
|
|
} |