public void drawGroundComms(StaticObject obj, LaunchSite lSite = null) { string Base = ""; string Base2 = ""; float Range = 0f; LaunchSite lBase = null; LaunchSite lBase2 = null; Vector3 pos = Vector3.zero; if (lSite != null) { GameObject golSite = lSite.GameObject; pos = MapView.MapCamera.GetComponent <Camera>().WorldToScreenPoint(ScaledSpace.LocalToScaledSpace(golSite.transform.position)); LaunchSiteManager.getNearestBase(golSite.transform.position, out Base, out Base2, out Range, out lBase, out lBase2); } if (obj != null) { pos = MapView.MapCamera.GetComponent <Camera>().WorldToScreenPoint(ScaledSpace.LocalToScaledSpace(obj.gameObject.transform.position)); LaunchSiteManager.getNearestBase(obj.gameObject.transform.position, out Base, out Base2, out Range, out lBase, out lBase2); } Vector3 vNeighbourPos = Vector3.zero; Vector3 vNeighbourPos2 = Vector3.zero; Vector3 vBasePos = Vector3.zero; Vector3 vBasePos2 = Vector3.zero; GameObject goNeighbour = null; GameObject goNeighbour2 = null; if (Base != "") { if (Base == "KSC") { goNeighbour = SpaceCenterManager.KSC.gameObject; } else { goNeighbour = LaunchSiteManager.getSiteGameObject(Base); } } if (Base2 != "") { if (Base2 == "KSC") { goNeighbour2 = SpaceCenterManager.KSC.gameObject; } else { goNeighbour2 = LaunchSiteManager.getSiteGameObject(Base2); } } if (goNeighbour != null) { vNeighbourPos = goNeighbour.transform.position; vBasePos = MapView.MapCamera.GetComponent <Camera>().WorldToScreenPoint(ScaledSpace.LocalToScaledSpace(vNeighbourPos)); } if (goNeighbour2 != null) { vNeighbourPos2 = goNeighbour2.transform.position; vBasePos2 = MapView.MapCamera.GetComponent <Camera>().WorldToScreenPoint(ScaledSpace.LocalToScaledSpace(vNeighbourPos2)); } if (goNeighbour != null && vNeighbourPos != Vector3.zero && vBasePos != Vector3.zero) { NavUtils.CreateLineMaterial(1); GL.Begin(GL.LINES); NavUtils.lineMaterial1.SetPass(0); GL.Color(new Color(1f, 1f, 1f, 0.7f)); GL.Vertex3(pos.x - Screen.width / 2, pos.y - Screen.height / 2, pos.z); GL.Vertex3(vBasePos.x - Screen.width / 2, vBasePos.y - Screen.height / 2, vBasePos.z); GL.End(); } if (goNeighbour2 != null && vNeighbourPos2 != Vector3.zero && vBasePos2 != Vector3.zero) { NavUtils.CreateLineMaterial(2); GL.Begin(GL.LINES); NavUtils.lineMaterial2.SetPass(0); GL.Color(new Color(1f, 1f, 1f, 0.7f)); GL.Vertex3(pos.x - Screen.width / 2, pos.y - Screen.height / 2, pos.z); GL.Vertex3(vBasePos2.x - Screen.width / 2, vBasePos2.y - Screen.height / 2, vBasePos2.z); GL.End(); } }