You have to make sure both the Connection class and the class where the list is are in the same namespace, or, if not, that you are referencing the namespace.
Also, if you put a script in a folder called “Editor”, Unity compiles it in another assembly. Make sure both or neither are in that folder.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Connection
{
//I don't know what library you're using :(
public Vector3 target1;
public Vector3 target2;
public string cType;
}
So here is the script that’s referencing Connection:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ReferenceConnection
{
List<Connection> getConnection = new List<Connection>();
}
So here is a picture of the editor where I keep my scripts: