private bool ConnectionExists(StarController oldStar, StarController newStar) { bool result = false; if (_starConnections.ContainsKey(oldStar)) { Debug.Log("Connection between " + oldStar.name + " exists for some connection"); if (_starConnections[oldStar].Find(x => x.connectedStar.GetInstanceID() == newStar.GetInstanceID()) != null) { result = true; } } if (!result) { if (_starConnections.ContainsKey(newStar)) { if (_starConnections[newStar].Find(x => x.connectedStar.GetInstanceID() == oldStar.GetInstanceID()) != null) { result = true; } } } return result; }