// Copy list of joints and edges to the clipboard // Mostly copied from BridgeSelectionSet private static void CopyToClipboard(List <BridgeJoint> m_Joints, List <BridgeEdge> m_Edges) { ClipboardManager.ClearClipboard(); ClipboardManager.SetContainerPosition(GameUI.SnapPosToGrid(Utils.GetWorldPointFromScreenPos(Input.mousePosition))); ClipboardManager.AlignClipboardAnchors(); Vector2 vector = CalculateSelectSetCenter(m_Joints, m_Edges); foreach (BridgeJoint joint in m_Joints) { if (!joint.m_IsAnchor || BridgeEdges.EdgeIsConnectedToJoint(joint)) { ClipboardManager.AddJoint(Utils.V3toV2(joint.transform.position) - vector, joint); } } foreach (BridgeEdge edge in m_Edges) { float z = edge.transform.localEulerAngles.z; float length = edge.GetLength(); ClipboardManager.AddEdge(Utils.V3toV2(edge.transform.position) - vector, z, length, edge); if (!m_Joints.Contains(edge.m_JointA)) { ClipboardManager.AddJoint(Utils.V3toV2(edge.m_JointA.transform.position) - vector, edge.m_JointA); } if (!m_Joints.Contains(edge.m_JointB)) { ClipboardManager.AddJoint(Utils.V3toV2(edge.m_JointB.transform.position) - vector, edge.m_JointB); } } }