// Connect this board space with another, creating a line between them public void Connect(BoardSpace space) { Vector3 lineStart = GetScreenPosition(); Vector3 lineEnd = space.GetScreenPosition(); ConnectionLine line = connectionLines.GetUnusedLine(); line.SetPoints(lineStart, lineEnd); connectedSpaces.Add(space); }
// Line from the last connected space to the touch position void UpdateLine(Vector3 touchPos) { if (!currentDotLink.IsEmpty()) { BoardSpace lastConnected = currentDotLink.lastConnected; Vector3 lineStart = lastConnected.GetScreenPosition(); touchLine.SetType(lastConnected.GetCurrentDot().GetDotType()); touchLine.SetPoints(lineStart, touchPos); } }