add "Add Collider" and "Add To Layer" properties to terrain factory#57
add "Add Collider" and "Add To Layer" properties to terrain factory#57david-rhodes merged 7 commits intodevelopfrom
Conversation
| //go.AddComponent<MeshCollider>(); | ||
| //go.layer = LayerMask.NameToLayer("terrain"); | ||
| if (_addMeshCollider) | ||
| tile.gameObject.AddComponent<MeshCollider>(); |
There was a problem hiding this comment.
If this is a flat mesh, can we instead use a box collider @brnkhy?
| [SerializeField] | ||
| private bool _addToLayer = false; | ||
| [SerializeField] | ||
| private int _layerId = 0; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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"); |
fix if clause syntax
…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.
add "Add Collider" and "Add To Layer" properties to terrain factory