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

public class Cable : MonoBehaviour
{
    public float length = 1;
    public ValueProvider value;
    public Transform anchor;
    public GameObject on;
    public GameObject off;

    public void Build()
    {
        anchor.localScale = new Vector3(1, 1, length);
    }

    private void Update()
    {
        on.SetActive(value.value);
        off.SetActive(!value.value);
    }

    private void OnValidate()
    {
        Build();
    }
}
