Skip to content

add "Add Collider" and "Add To Layer" properties to terrain factory#57

Merged
david-rhodes merged 7 commits intodevelopfrom
terrainFactorySettings
May 9, 2017
Merged

add "Add Collider" and "Add To Layer" properties to terrain factory#57
david-rhodes merged 7 commits intodevelopfrom
terrainFactorySettings

Conversation

@brnkhy
Copy link
Copy Markdown
Contributor

@brnkhy brnkhy commented May 9, 2017

add "Add Collider" and "Add To Layer" properties to terrain factory

//go.AddComponent<MeshCollider>();
//go.layer = LayerMask.NameToLayer("terrain");
if (_addMeshCollider)
tile.gameObject.AddComponent<MeshCollider>();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a flat mesh, can we instead use a box collider @brnkhy?

[SerializeField]
private bool _addToLayer = false;
[SerializeField]
private int _layerId = 0;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the layer option be in the base class? It makes sense for all factories to have the ability to specify which layer they place objects in. Further down the chain, specific stacks can offer layer overrides?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not all factories actually create game objects (like map image factory). And in mesh factory, it would make much more sense to have layer visualizers have this instead of the factory OR even better, have a layer modifier etc.
so I'm not sure about moving this down to base class

//go.AddComponent<MeshCollider>();
//go.layer = LayerMask.NameToLayer("terrain");

if (_addMeshCollider)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pedantic, but please always use braces.

customMapId_Prop = serializedObject.FindProperty("_customMapId");
collider_Prop = serializedObject.FindProperty("_addMeshCollider");
addLayer_Prop = serializedObject.FindProperty("_addToLayer");
addLayer_Prop = serializedObject.FindProperty("_addToLayer");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate line?

brnkhy and others added 6 commits May 9, 2017 19:34
…rainFactorySettings

# Conflicts:
#	sdkproject/Assets/Mapbox/Core/Unity/MeshGeneration/Factories/MapImageFactory.cs
#	sdkproject/Assets/Mapbox/Core/Unity/MeshGeneration/Factories/TerrainFactory.cs
Changing mesh collider to just collider.
Adding custom map id property for editor.
@david-rhodes david-rhodes self-assigned this May 9, 2017
@david-rhodes david-rhodes merged commit 2998432 into develop May 9, 2017
@david-rhodes david-rhodes deleted the terrainFactorySettings branch May 9, 2017 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants