IEnumerator NodeMove() { while (Input.GetMouseButton(1)) { gameObject.transform.position = Camera.main.ScreenToWorldPoint(Input.mousePosition) + new Vector3(0f, 0f, 9f); yield return(null); } foreach (CountryNode node in parentCC.nodes) { if (node == this) { continue; } if (MeshMaker.GetDistance(node.gameObject.transform.position, gameObject.transform.position) <= nodeSize) { country.MergeInto(node.country); break; } } }
float LinkDist() { return(MeshMaker.GetDistance(nodes [0].transform.position, nodes [1].transform.position)); }