public void ClickedWaypointMarker(WaypointMarker marker) { int currentType = (int)marker.Waypoint.ThresholdZone.ThresholdZoneType; currentType++; if (currentType > 3) { currentType = 0; } ThresholdZone newZone = _thresholdZoneDict[(ThresholdZoneType)currentType]; marker.SetThresholdZone(newZone); UpdateMarker(marker); }
public WaypointMarker CreateWaypoint(Vector3 waypointPosition) { foreach (WaypointMarker marker in _waypointMarkers) { marker.SetLock(true); } _lineRendererRoute.positionCount++; _lineRendererRoute.SetPosition(_lineRendererRoute.positionCount - 1, waypointPosition); WaypointMarker waypoint = Instantiate(_waypointMarkerPrefab, waypointPosition, Quaternion.identity).GetComponent <WaypointMarker>(); ThresholdZone zone = _thresholdZoneDict[_defaultZoneType]; waypoint.SetWaypoint(new Waypoint { Point = waypointPosition.ToUTM().ToWGS84(), ThresholdZone = zone }); _waypointMarkers.Add(waypoint); PlayerUIController.Instance.UpdateUI(RobotMasterController.SelectedRobot); return(waypoint); }