UnityGameProjectsCode / InTheDarkGame / Debug / DrawConnectors.cs
DrawConnectors.cs
Raw
using UnityEngine;

public class DrawConnectors : MonoBehaviour
{
    public bool enableWireframe;
    private Marker mkr;
    private GameObject markerPrevious;
    private GameObject markerNext;
    public Color markerLineColor;

    public void OnDrawGizmos()
    {
        if (markerNext == null)
        {
            mkr = GetComponent<Marker>();
            markerPrevious = mkr.getPreviousConnector();
            markerNext = mkr.getNextConnector();
        }

        if (enableWireframe)
        {
            Gizmos.color = markerLineColor;
            Gizmos.DrawLine(gameObject.transform.position, markerNext.transform.position);
            Gizmos.DrawLine(gameObject.transform.position, markerPrevious.transform.position);
        }
    }
}