Class ModifierStack
Modifier Stacks
Modifier Stack can be thought as styles as as they contain all the data/settings for how the feature will be visualized.
They also create the game objects in default implementations in the sdk.
Currently there's two implementations of this; Modifier Stack and Merged Modifier Stack.They work almost exactly same
(logically) with one difference; modifier stacks creates a game object for each feature while merged modifier stack,
merges them up as the name suggest and create one game object for multiple(as many as possible) features.Both have
their advantages but the main factor here is the performance.Regular modifier stack creates individual game object so
it's easier to interact, move, animate etc features.But if you want to visualize whole San Francisco, that would mean
just 200k-300k buildings which would hit performance really hard. In such a case, especially if you don't need
individual interaction or something, you can use merged modifier stack, which will probably be able to create whole
SF around a few hundred game objects.
They contain two lists; mesh modifier list and game object modifier list.These modifiers are used to create and
decorate game objects.
Mesh modifiers generate data required for the game objects mesh. I.e.polygon mesh modifier triangulates the polygn,
height modifier extrudes the polygon and adds volume etc, uv modifier changes UV mapping etc.
Game object modifiers decorate created game objects, like settings material, interaction scripts, animations etc.
i.e.Material modifier sets materials to mesh and submeshes, highlight modifier adds mouse highlight to features,
feature behaviour adds a script to keep feature data on game objects etc.
So the idea here is; run all mesh modifiers first, generate all the data required for mesh.Create game object
using that mesh data.Run all game object modifiers to decorate that game object.
Inheritance
ScriptableObject
ModifierStack
Namespace:Mapbox.Unity.MeshGeneration.Modifiers
Assembly:cs.temp.dll.dll
Syntax
public class ModifierStack : ModifierStackBase
Fields
moveFeaturePositionTo
Declaration
public PositionTargetType moveFeaturePositionTo
Field Value
Methods
Clear()
Declaration
public override void Clear()
Overrides
Execute(UnityTile, VectorFeatureUnity, MeshData, GameObject, String)
Declaration
public override GameObject Execute(UnityTile tile, VectorFeatureUnity feature, MeshData meshData, GameObject parent = null, string type = "")
Parameters
Returns
Type |
Description |
GameObject |
|
Initialize()
Declaration
public override void Initialize()
Overrides
OnEnable()
Declaration
protected virtual void OnEnable()
OnUnregisterTile(UnityTile)
Declaration
public override void OnUnregisterTile(UnityTile tile)
Parameters