void Start() { currentDotLink = new CurrentDotLink(); dragInput.OnSwipe += OnSwipe; dragInput.OnTouchEnd += OnTouchEnd; touchLine = GameObject.Instantiate(connectionLinePrefab).GetComponent <ConnectionLine>(); }
// Determine if the given dot link contains a square public bool SquareExists(CurrentDotLink dotLink) { List <BoardSpace> linkSpaces = dotLink.GetConnectionSpaces(); for (int i = 0; i < linkSpaces.Count; i++) { List <BoardSpace> linkSpaceConnections = linkSpaces[i].GetConnectedSpaces(); for (int k = 0; k < linkSpaceConnections.Count; k++) { if (connectedSpaces.Contains(linkSpaceConnections[k])) { return(true); } connectedSpaces.Add(linkSpaceConnections[k]); } } return(false); }