Exemplo n.º 1
0
        /// <summary>
        /// Creates a building highlight and adds it to the WrldMap.
        /// </summary>
        /// <param name="buildingHighlightOptions">The BuildingHighlightOptions object specifying how to create the BuildingHighlight object.</param>
        /// <returns>The new BuildingHighlight object</returns>
        public BuildingHighlight CreateHighlight(BuildingHighlightOptions buildingHighlightOptions)
        {
            var createParamsInterop = new BuildingHighlightCreateParamsInterop
            {
                SelectionMode    = buildingHighlightOptions.GetSelectionMode(),
                Location         = buildingHighlightOptions.GetSelectionLocation().ToLatLongInterop(),
                ScreenPoint      = CameraHelpers.ScreenPointOriginTopLeft(buildingHighlightOptions.GetSelectionScreenPoint()),
                HighlightColor   = buildingHighlightOptions.GetColor().ToColorInterop(),
                ShouldCreateView = !buildingHighlightOptions.IsInformationOnly()
            };

            var highlightId = NativeBuildingsApi_CreateHighlight(NativePluginRunner.API, ref createParamsInterop);

            m_materialRepository.CreateAndAddHighlightMaterial(MakeMaterialId(highlightId), buildingHighlightOptions.GetColor());
            var buildingHighlight = new BuildingHighlight(
                this,
                highlightId,
                buildingHighlightOptions.GetColor(),
                buildingHighlightOptions.IsInformationOnly(),
                buildingHighlightOptions.GetBuildingInformationReceivedHandler());

            m_buildingHighlightIdToObject.Add(highlightId, buildingHighlight);

            var buildingInformation = TryFetchBuildingInformationForHighlight(buildingHighlight.Id);

            if (buildingInformation != null)
            {
                buildingHighlight.SetBuildingInformation(buildingInformation);
            }

            return(buildingHighlight);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Create a BuildingHighlight object, for displaying graphical highlighting of a building, or for obtaining information about a building on the map.
 /// </summary>
 /// <param name="buildingHighlightOptions">Creation options - see BuildingHighlightOptions for details.</param>
 /// <returns>A new BuildingHighlight object.</returns>
 public BuildingHighlight CreateHighlight(BuildingHighlightOptions buildingHighlightOptions)
 {
     return(m_apiInternal.CreateHighlight(buildingHighlightOptions));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creates a building highlight and adds it to the WrldMap.
 /// </summary>
 /// <param name="buildingHighlightOptions">The BuildingHighlightOptions object specifying how to create the BuildingHighlight object.</param>
 /// <returns>The new BuildingHighlight object</returns>
 public static BuildingHighlight Create(BuildingHighlightOptions buildingHighlightOptions)
 {
     return(Api.Instance.BuildingsApi.CreateHighlight(buildingHighlightOptions));
 }