private void updateLineRenderers() { switch (LineType) { case lineType.arc: thisLR.SetPositions(GeoPlanetMaths.greatArcCoordinates(associatedPins[0], associatedPins[1])); updateDistanceText(); break; case lineType.circle: thisLR.SetPositions(GeoPlanetMaths.greatCircleCoordinates(associatedPins[0], associatedPins[1])); break; default: isVisible = false; break; } }
public void instantiateGreatCircle(pinData pinA, pinData pinB) { if (!circlesExist.Contains(pinA.pin.name + pinB.pin.name)) { circlesExist.Add(pinA.pin.name + pinB.pin.name); LineRenderer newLR = RSDESGeneratedLine(); newLR.GetComponent <RSDESLineData>().associatedPins = new List <pinData> { pinA, pinB }; newLR.GetComponent <RSDESLineData>().LineType = lineType.circle; newLR.startWidth = LR_width; newLR.endWidth = LR_width; newLR.positionCount = LR_Resolution; newLR.SetPositions(GeoPlanetMaths.greatCircleCoordinates(pinA.pin.transform.position, pinB.pin.transform.position, LR_Resolution)); if (verboseLogging) { Debug.Log(newLR.name + " was created for the two points."); } newLR.loop = true; } }