예제 #1
0
        private static void Connect(ushort node1, ushort node2, Vector3 startDir, Vector3 endDir, NetInfo Info, bool invert = false)
        {
            //Debug.Log("Connectiong nodes " + node1 + " and " + node2);

            NetNode netNode1 = NetAccess.GetNode(node1);
            NetNode netNode2 = NetAccess.GetNode(node2);

            if ((netNode1.m_position - netNode2.m_position).magnitude < MIN_SEGMENT_LENGTH)
            {
                RepairShortSegment(ref endDir, ref node2);
            }

            //NetAccess.CreateSegment(node1,node2,(netNode2.m_position-netNode1.m_position).normalized, (netNode1.m_position - netNode2.m_position).normalized, info, invert);
            try
            {
                NetAccess.CreateSegment(node1, node2, startDir, endDir, Info, invert);
            }
            catch (Exception e)
            {
                Debug.LogWarning(e);
            }
        }