Skip to content

Api ui integration vector texturing #1031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 87 commits into from
Sep 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
4b58411
add a proof of concept for partial layer updates
brnkhy Sep 12, 2018
82239c4
Replaced bare EditorHelper.CheckForModifiedProperty calls with Editor…
greglemonmapbox Sep 12, 2018
2417b45
- Added property.serializedObject.Update() calls to beginning of OnGU…
greglemonmapbox Sep 12, 2018
0c46d9c
Temporarily disabled Vector Update business in abstract map.
greglemonmapbox Sep 12, 2018
dbb0e13
Adding/removing mesh and/or gameplay modifiers now triggers change ev…
greglemonmapbox Sep 12, 2018
cb8d770
Removed unused EndChangeCheck call in BehaviorModifiersSectionDrawer;…
greglemonmapbox Sep 12, 2018
d3bfec0
Added support for change events in vector filter section.
greglemonmapbox Sep 12, 2018
cf9fb31
Fix ui errors vector section (#1011)
abhishektrip Sep 13, 2018
b65022a
Added UI update checks for Behavior Modifier section.
greglemonmapbox Sep 13, 2018
13c30d1
Removed unused delegate and method.
greglemonmapbox Sep 13, 2018
f5b42dd
Removed property.serializedObject.Update call at beginning of OnGUI.
greglemonmapbox Sep 13, 2018
64b309d
Adding/removing map features now triggers update event.
greglemonmapbox Sep 13, 2018
090a371
Enabling/disabling map feature checkboxes now fires UI update events.
greglemonmapbox Sep 13, 2018
4c5b5b5
Changing DataSource in map features section now triggers update. For …
greglemonmapbox Sep 13, 2018
d988e2e
VectorUpdate is now working; map redraws vector section on vector-cen…
greglemonmapbox Sep 13, 2018
74a2125
hook terrain layer property to property changed event.
abhishektrip Sep 13, 2018
cdbf164
Use the variable to set collider.
abhishektrip Sep 13, 2018
141b3d8
Add helper methods
abhishektrip Sep 13, 2018
c429c5b
Merge commit 'b88ed6d0ae1f7a55197456143f9cd25c0de18bbf' into partialU…
abhishektrip Sep 14, 2018
6c6530f
Add update methods to MapboxDataProperty
abhishektrip Sep 14, 2018
a223385
Use new methods in MapboxDataProperty.
abhishektrip Sep 14, 2018
3492366
Merge commit 'd988e2e1d1747450788e40446e4d8eeac11ecba5' into api-ui-i…
abhishektrip Sep 14, 2018
ec15989
Remove SerializedObject.update
abhishektrip Sep 17, 2018
f4bb1ae
Add ChangeCheck for Vector DataSource.
abhishektrip Sep 17, 2018
8636977
Add NeedsForceUpdate override
abhishektrip Sep 17, 2018
726aa3a
Switch to UpdateProperty
abhishektrip Sep 17, 2018
79a3aee
Change Active from field to Property.
abhishektrip Sep 17, 2018
e12a300
Update signature for NotifyUpdateLayer
abhishektrip Sep 17, 2018
183cf58
Add ChangeImagery method to test.
abhishektrip Sep 17, 2018
f1c075c
Add VectorLayerUpdateArgs + overload for NotifyUpdateLayer
abhishektrip Sep 18, 2018
c442a1e
Hook to UpdateTileFactory event
abhishektrip Sep 18, 2018
ec30494
Add hooks to UpdateModifier Event
abhishektrip Sep 18, 2018
7fb975c
Add abstract SublayerProperty
abhishektrip Sep 18, 2018
443acd6
Add UnregisterTilesFromLayer method
abhishektrip Sep 18, 2018
ebc90ed
Add method to change texturing type.
abhishektrip Sep 18, 2018
2d8f7b7
Remove static MapboxDefaultStyle class.
abhishektrip Sep 19, 2018
6942fcf
Add event hookup to modifiers
abhishektrip Sep 19, 2018
20573a5
Add layer args for vector layers
abhishektrip Sep 19, 2018
6c1713f
Add events for Add/Remove layer
abhishektrip Sep 19, 2018
281587e
Add events for modifiers.
abhishektrip Sep 19, 2018
b3ff8f1
Change HasChanged to virtual, add overrides
abhishektrip Sep 19, 2018
c511fe0
Add event hookup to modifiers
abhishektrip Sep 19, 2018
fc5802f
Code cleanup
abhishektrip Sep 19, 2018
8f20024
Trigger Collider option change from UI
abhishektrip Sep 19, 2018
df58f7e
Add a method to re-intialize stack.
abhishektrip Sep 19, 2018
e64ab44
Clean out stacks before recreating the layer.
abhishektrip Sep 19, 2018
dad7ec7
Add events to trigger SubLayerAdded from UI
abhishektrip Sep 19, 2018
b693e90
Remove Layer API and hooks
abhishektrip Sep 20, 2018
7ade40b
Add missing property
abhishektrip Sep 20, 2018
8b32a75
Add function to unbind properties from modifier.
abhishektrip Sep 21, 2018
fc6970b
UpdateVector method now unbinds all modifiers.
abhishektrip Sep 21, 2018
a1c9d23
Merge commit 'dedb355fb936838a9927b6036786cf95dc202f6b' into api-ui-i…
abhishektrip Sep 21, 2018
65650ac
remove SnapTerrain and CombineMeshes from points.
abhishektrip Sep 21, 2018
aff6ddf
Add UpdateMap call to trigger when UI is changed.
abhishektrip Sep 21, 2018
6cc03f7
extract lineGeometryOptions to its own class (with drawer)
brnkhy Sep 21, 2018
15888bb
add update event support to poi layer
brnkhy Sep 21, 2018
f589aa0
extract lineGeometryOptions to its own class (with drawer)
brnkhy Sep 21, 2018
786394e
add update event support to poi layer
brnkhy Sep 21, 2018
e51737b
Merge branch 'api-ui-integration' of github.com:mapbox/mapbox-unity-s…
abhishektrip Sep 24, 2018
0934e9a
fix a bug where prefab modifier rupdate event registration wasn't fir…
brnkhy Sep 24, 2018
56dc37a
fix filtering poi category by none with a hacky solution
brnkhy Sep 24, 2018
6e30b30
Merge branch 'api-ui-integration' of github.com:mapbox/mapbox-unity-s…
abhishektrip Sep 24, 2018
bade8c7
Remove hack with a fix for POILayer being set to None.
abhishektrip Sep 24, 2018
ababa59
Add map update logic to General section UI events.
abhishektrip Sep 24, 2018
420d13e
Add property to trigger separate events for extentType & Extent prope…
abhishektrip Sep 24, 2018
4627549
Property drawer changes for extentOptions
abhishektrip Sep 24, 2018
458e19e
Add API methods for General Section functionality.
abhishektrip Sep 25, 2018
022a115
Add APi method for snapMapToZero.
abhishektrip Sep 25, 2018
55a1d20
add api methods to terrain and imagery layers
brnkhy Sep 25, 2018
3343553
Fix typo.
abhishektrip Sep 25, 2018
6e3506f
Fix typo
abhishektrip Sep 25, 2018
931a9b7
add update system functionality to add/remove poi layers on data prop…
abhishektrip Sep 25, 2018
c48bd6e
fix an issue where poi layer didn't create prefab modifier for name a…
brnkhy Sep 26, 2018
868d7e0
Vector Filter options API calls.
greglemonmapbox Sep 26, 2018
c65be41
Added additional API methods.
greglemonmapbox Sep 26, 2018
af67396
Add multiple property methods (#1026)
brnkhy Sep 27, 2018
11ec1d9
Move poi methods (#1023)
brnkhy Sep 27, 2018
fffb81c
Merge remote-tracking branch 'origin/api-ui-integration' into api-ui-…
greglemonmapbox Sep 27, 2018
78af0aa
Added API methods for interacting with texture style options.
greglemonmapbox Sep 27, 2018
bad0fc4
Added API Get/Set methods and CustomStyleBundle class.
greglemonmapbox Sep 27, 2018
e23d828
Merge remote-tracking branch 'origin/develop' into api-ui-integration…
greglemonmapbox Sep 27, 2018
0232b92
Removed duplicate methods in EditorHelper. Added comments and regions…
greglemonmapbox Sep 27, 2018
0086b69
Marked all API methods as virtual.
greglemonmapbox Sep 27, 2018
8da7c3e
Added VectorTextureApiTest.
greglemonmapbox Sep 28, 2018
3e7b03b
Replaced new Material(material) calls with = material; renamed GetCus…
greglemonmapbox Sep 28, 2018
b3eca8d
Wrapper for public interfaces
abhishektrip Sep 28, 2018
bf8708d
interface templates
abhishektrip Sep 28, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 103 additions & 5 deletions sdkproject/Assets/ApiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using Mapbox.Unity.Map;
using Mapbox.Unity.MeshGeneration.Interfaces;
using Mapbox.Unity.MeshGeneration.Filters;
using UnityEngine;

public class ApiTest : MonoBehaviour
Expand All @@ -11,8 +12,17 @@ public class ApiTest : MonoBehaviour
public ImagerySourceType imagerySource = ImagerySourceType.MapboxStreets;

public LocationPrefabCategories LocationPrefabCategories;
public LayerFilterOperationType layerFilterOperationType;
public GameObject PoiPrefab;


public LayerFilterCombinerOperationType layerFilterCombinerOperationType;
public string filterKey;

public float min;
public float max;
public string contains;

readonly StyleTypes[] testStyles = new StyleTypes[3] { StyleTypes.Fantasy, StyleTypes.Realistic, StyleTypes.Simple };
int styleId = -1;
void Start()
Expand Down Expand Up @@ -113,7 +123,7 @@ public void ChangeBuildingMaterial()
var layer = _abstractMap.VectorData.LayerProperty.FindFeatureLayerWithName("ExtrudedBuildings");
if (layer != null)
{
layer.SetTexturingType(testStyles[styleId]);
layer.SetStyleType(testStyles[styleId]);
}
else
{
Expand Down Expand Up @@ -175,7 +185,6 @@ public void ChangePoiCategory()
{
var pois = _abstractMap.VectorData.LayerProperty.FindPoiLayerWithName("loc");
pois.categories = LocationPrefabCategories;
Debug.Log("ChangePoiCategory ---> " + pois.GetType().ToString()); //PrefabItemOptions
pois.HasChanged = true;
}

Expand All @@ -184,7 +193,6 @@ public void ChangePoiPrefab()
{
var pois = _abstractMap.VectorData.LayerProperty.FindPoiLayerWithName("loc");
pois.spawnPrefabOptions.prefab = PoiPrefab;
Debug.Log("ChangePoiPrefab ---> " + pois.spawnPrefabOptions.GetType().ToString());//SpawnPrefabOptions
pois.spawnPrefabOptions.HasChanged = true;
}

Expand All @@ -194,7 +202,6 @@ public void ChangeToPoiByName()
var pois = _abstractMap.VectorData.LayerProperty.FindPoiLayerWithName("loc");
pois.findByType = LocationPrefabFindBy.POIName;
pois.nameString = "yerba";
Debug.Log("ChangeToPoiByName ---> " + pois.GetType().ToString());//PrefabItemOptions
pois.HasChanged = true;
}

Expand All @@ -203,10 +210,101 @@ public void ChangeToCategory()
{
var pois = _abstractMap.VectorData.LayerProperty.FindPoiLayerWithName("loc");
pois.findByType = LocationPrefabFindBy.MapboxCategory;
Debug.Log("ChangeToCategory ---> " + pois.GetType().ToString());//PrefabItemOptions
pois.HasChanged = true;
}

[ContextMenu("Vector - Add New Filter")]
public void AddNewFilter()
{
var vectorLayer = _abstractMap.VectorData.LayerProperty.FindFeatureLayerWithName("loc");
LayerFilter layerFilter = new LayerFilter(LayerFilterOperationType.Contains);
vectorLayer.filterOptions.filters.Add(layerFilter);
vectorLayer.filterOptions.HasChanged = true;
}

[ContextMenu("Vector - Remove Filter")]
public void RemoveFilter()
{
int index = 0;
var vectorLayer = _abstractMap.VectorData.LayerProperty.FindFeatureLayerWithName("loc");
if(index < vectorLayer.filterOptions.filters.Count)
{
vectorLayer.filterOptions.filters.RemoveAt(index);
}
vectorLayer.filterOptions.HasChanged = true;
}

[ContextMenu("Vector - Set Filter Combiner Type")]
public void SetFilterCombinerType()
{
var vectorLayer = _abstractMap.VectorData.LayerProperty.FindFeatureLayerWithName("loc");

vectorLayer.filterOptions.combinerType = layerFilterCombinerOperationType;

vectorLayer.filterOptions.HasChanged = true;
}

[ContextMenu("Vector - Set Filter Key")]
public void SetFilterKey()
{
int index = 0;
var vectorLayer = _abstractMap.VectorData.LayerProperty.FindFeatureLayerWithName("loc");
if (index < vectorLayer.filterOptions.filters.Count)
{
vectorLayer.filterOptions.filters[index].Key = filterKey;
}
vectorLayer.filterOptions.HasChanged = true;
}

[ContextMenu("Vector - Set Filter Operator")]
public void SetFilterOperator()
{
int index = 0;
var vectorLayer = _abstractMap.VectorData.LayerProperty.FindFeatureLayerWithName("loc");
if (index < vectorLayer.filterOptions.filters.Count)
{
vectorLayer.filterOptions.filters[index].filterOperator = layerFilterOperationType;
}
vectorLayer.filterOptions.HasChanged = true;
}

[ContextMenu("Vector - Set Filter Min Value")]
public void SetFilterCompareValue()
{
int index = 0;
var vectorLayer = _abstractMap.VectorData.LayerProperty.FindFeatureLayerWithName("loc");
if (index < vectorLayer.filterOptions.filters.Count)
{
vectorLayer.filterOptions.filters[index].Min = min;
}
vectorLayer.filterOptions.HasChanged = true;
}

[ContextMenu("Vector - Set Filter Compare MinMaxValue")]
public void SetFilterCompareMinMaxValue()
{
int index = 0;
var vectorLayer = _abstractMap.VectorData.LayerProperty.FindFeatureLayerWithName("loc");
if (index < vectorLayer.filterOptions.filters.Count)
{
vectorLayer.filterOptions.filters[index].Min = min;
vectorLayer.filterOptions.filters[index].Max = max;
}
vectorLayer.filterOptions.HasChanged = true;
}

[ContextMenu("Vector - Set Filter Contains Value")]
public void SetFilterContainsValue()
{
int index = 0;
var vectorLayer = _abstractMap.VectorData.LayerProperty.FindFeatureLayerWithName("loc");
if (index < vectorLayer.filterOptions.filters.Count)
{
vectorLayer.filterOptions.filters[index].PropertyValue = contains;
}
vectorLayer.filterOptions.HasChanged = true;
}

[ContextMenu("TestPoiCategoryApi")]
public void TestPoiCategoryApi()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,17 @@
using Mapbox.Unity.MeshGeneration.Modifiers;
using Mapbox.Unity.MeshGeneration.Data;

public class CustomStyleBundle
{
public Material topMaterial;
public Material sideMaterial;
public AtlasInfo atlasInfo;
public ScriptablePalette colorPalette;
}

[Serializable]
public class GeometryMaterialOptions : ModifierProperties
public class GeometryMaterialOptions : ModifierProperties, ISubLayerTexturing

{
public override Type ModifierType
{
Expand Down Expand Up @@ -128,6 +137,11 @@ public void SetDefaultAssets()
texturingType = UvMapType.Atlas;
AssignAssets(styleAssetPathBundle);
}

public void SetDefaultStyleType(StyleTypes style)
{
throw new NotImplementedException();
}
}

[Serializable]
Expand Down
Loading