using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class Cable : MonoBehaviour
{
    [ReadOnly]public SocketChannelSettings channel;
    [ReadOnly] public List<CableSection> cableSections;
    [ReadOnly] public CableSection terminalSection;
    [ReadOnly] public LineRenderer lineRenderer;
    public bool isActive;
    
    void LateUpdate ()
    {
        UpdateLineRendererPositions();
    }

    public void UpdateLineRendererPositions ()
    {
        if (isActive)
        {
            for (int i = 0; i < cableSections.Count; i++)
            {
                lineRenderer.SetPosition(i, cableSections [i].transform.position);
            }
        }
    }
}
