namespace Mapbox.Unity.Map { using UnityEngine; using System.Collections; using System; using System.Collections.Generic; using Mapbox.Unity.MeshGeneration.Modifiers; using Mapbox.Unity.Utilities; using Mapbox.Unity.MeshGeneration.Filters; [Serializable] public class PrefabItemOptions : VectorSubLayerProperties { #region Fixed Properties //Fixed primitiveType public readonly VectorPrimitiveType primitiveType = VectorPrimitiveType.Point; //Group features turned off public readonly bool combineMeshes = false; //No extrusion public readonly ExtrusionType extrusionType = ExtrusionType.None; //Dictionary containing the layer names for each location prefab find by type public readonly Dictionary layerNameFromFindByTypeDictionary = new Dictionary { {LocationPrefabFindBy.AddressOrLatLon, ""}, {LocationPrefabFindBy.MapboxCategory, "poi_label"}, {LocationPrefabFindBy.POIName, "poi_label"}, }; //Dictionary containing the property names in the layer for each location prefab find by type public readonly Dictionary categoryPropertyFromFindByTypeDictionary = new Dictionary { {LocationPrefabFindBy.AddressOrLatLon, ""}, {LocationPrefabFindBy.MapboxCategory, "maki"}, {LocationPrefabFindBy.POIName, "name"}, }; //Dictionary containing the density names in the layer for each location prefab find by type public readonly Dictionary densityPropertyFromFindByTypeDictionary = new Dictionary { {LocationPrefabFindBy.AddressOrLatLon, ""}, {LocationPrefabFindBy.MapboxCategory, "localrank"}, {LocationPrefabFindBy.POIName, "localrank"}, }; //Dictionary containing the density names in the layer for each location prefab find by type public readonly Dictionary namePropertyFromFindByTypeDictionary = new Dictionary { {LocationPrefabFindBy.AddressOrLatLon, ""}, {LocationPrefabFindBy.MapboxCategory, ""}, {LocationPrefabFindBy.POIName, "name"}, }; //Force Move prefab feature position to the first vertex public readonly PositionTargetType _movePrefabFeaturePositionTo = PositionTargetType.FirstVertex; public readonly LayerFilterCombinerOperationType _combinerType = LayerFilterCombinerOperationType.All; #endregion #region User Choice Properties /// /// Gets or sets a value indicating whether this item is active. /// /// true if is active; otherwise, false. public bool isActive { get { return coreOptions.isActive; } set { coreOptions.isActive = value; } } public bool snapToTerrain { get { return coreOptions.snapToTerrain; } set { coreOptions.snapToTerrain = value; } } public string prefabItemName { get { return coreOptions.sublayerName; } set { coreOptions.sublayerName = value; } } /// /// The prefab to be spawned on the map /// public SpawnPrefabOptions spawnPrefabOptions; /// /// Find points-of-interest to spawn prefabs using this enum /// public LocationPrefabFindBy findByType = LocationPrefabFindBy.MapboxCategory;//default to Mapbox Category /// /// Spawn at any location in the categories selected /// public LocationPrefabCategories categories; /// /// Spawn at any location containing this name string /// public string nameString = "Name"; /// /// Spawn at specific coordinates /// [Geocode] public string[] coordinates; [Range(1, 30)] public int density = 15; public Action> OnAllPrefabsInstantiated { get { return spawnPrefabOptions.AllPrefabsInstatiated; } set { spawnPrefabOptions.AllPrefabsInstatiated = value; } } #endregion public override bool HasChanged { set { if (value == true) { OnPropertyHasChanged(new VectorLayerUpdateArgs { property = this }); } } } } }