private void OnWillCreateSegment(WillCreateSegmentArgs args) { // Set the width of the road segments. args.Style = new SegmentStyle.Builder(args.Style) { Width = RoadWidth }.Build(); }
private void OnWillCreateSegment(WillCreateSegmentArgs args) { // Set the width of road and non-road segments. args.Style = new SegmentStyle.Builder(args.Style) { Width = Vehicle.IsTraversableRoad(args.MapFeature) ? RoadWidth : RoadWidth / 2 }.Build(); }
/// <summary> /// Checks Metadata, and assigns a new material to any road that is marked as private. /// </summary> /// <param name="args">Segment creation event arguments.</param> private void WillCreateHandler(WillCreateSegmentArgs args) { if (args.MapFeature.Metadata.IsPrivate) { // If the segment that is being created is marked private, change the material in the style // used to display the segment. SegmentStyle.Builder style = args.Style.AsBuilder(); style.Material = PrivateRoadMaterial; args.Style = style.Build(); } }
/// <summary> /// Handle <see cref="SegmentEvents.WillCreate"/> event by specifying the segment styles. /// </summary> /// <param name="args">Event arguments.</param> public void HandleWillCreateSegment(WillCreateSegmentArgs args) { args.Style = GameObjectOptions.SegmentStyle; }
/// <summary> /// Triggered by the Maps SDK during the loading process. /// Notifies the SDK if the GameObject for segments needs to be created (or not) based on the /// value of the UI flag. /// </summary> void OnWillCreateSegment(WillCreateSegmentArgs args) { args.Cancel = !ShowSegments; }
/// <summary> /// Handle <see cref="SegmentEvents.WillCreate"/> event by specifying the segment styles. /// </summary> public void HandleWillCreateSegment(WillCreateSegmentArgs arguments) { arguments.Style = _mapDefaultStyle.SegmentStyle; }