Google.Maps.Decoration.ExtrudedStructureDecorator

Encapsulates helper methods that allow you to style ExtrudedStructures.

Summary

These methods allow you to enhance map feature GameObjects that have Feature.ExtrudedStructure components attached to them, by placing decorative child GameObjects on them.

Public static functions

AddMultipleVolumeRoofDecorations(GameObject extrudedStructureGameObject, Func< GameObject > roofDecorationPrefabGenerator, float marginSize)
int
Adds multiple volume roof decorations on the rooftop of a GameObject representing an Feature.ExtrudedStructure so that the roof decorations fill in a rooftop area.
AddPointRoofDecoration(GameObject extrudedStructureGameObject, GameObject roofDecorationPrefab, float marginSize)
bool
Adds a point-like roof decoration to the rooftop of a GameObject representing an Feature.ExtrudedStructure.
AddVolumeRoofDecoration(GameObject extrudedStructureGameObject, GameObject roofDecorationPrefab, float marginSize)
bool
Adds a volume roof decoration to the rooftop of a Feature.ExtrudedStructure.

Public static functions

AddMultipleVolumeRoofDecorations

int AddMultipleVolumeRoofDecorations(
  GameObject extrudedStructureGameObject,
  Func< GameObject > roofDecorationPrefabGenerator,
  float marginSize
)

Adds multiple volume roof decorations on the rooftop of a GameObject representing an Feature.ExtrudedStructure so that the roof decorations fill in a rooftop area.

This method will instantiate Prefabs, given by a Prefab generator, as children of an Feature.ExtrudedStructure's GameObject at random positions on the rooftop, with default rotation and scale.

This method returns the number of roof decorations successfully placed.

Details
Parameters
extrudedStructureGameObject
A GameObject with an ExtrudedStructureComponent component attached.
roofDecorationPrefabGenerator
A delegate that returns a Prefab to be used for each roof decoration. Each Prefab returned by a generator must have a CircularMarker component attached to it.
marginSize
A margin that determines how close roof decorations can be placed to the edge of the roof.
Exceptions
ArgumentException
If extrudedStructureGameObject does not have an ExtrudedStructureComponent component attached.
ArgumentException
If marginSize is negative.
MapsException
If roofDecorationPrefabGenerator does not return a Prefab that has a CircularMarker component attached to it.

AddPointRoofDecoration

bool AddPointRoofDecoration(
  GameObject extrudedStructureGameObject,
  GameObject roofDecorationPrefab,
  float marginSize
)

Adds a point-like roof decoration to the rooftop of a GameObject representing an Feature.ExtrudedStructure.

This method instantiates a given Prefab as a child of an Feature.ExtrudedStructure at a random position on the rooftop, with default rotation and scale.

When the roof decoration is added successfully, this method returns true (otherwise, returns false). This method is guaranteed to be successful when marginSize equals 0.

Details
Parameters
extrudedStructureGameObject
A map feature GameObject with an Feature.ExtrudedStructure component attached.
roofDecorationPrefab
A Prefab to be used as a roof decoration.
marginSize
A value that determines how close a roof decoration can be placed to the edge of the roof.
Exceptions
ArgumentException
Thrown when marginSize is negative.

AddVolumeRoofDecoration

bool AddVolumeRoofDecoration(
  GameObject extrudedStructureGameObject,
  GameObject roofDecorationPrefab,
  float marginSize
)

Adds a volume roof decoration to the rooftop of a Feature.ExtrudedStructure.

This method attempts to instantiate a given Prefab as a child of an Feature.ExtrudedStructure, placing the prefab at a random position on the rooftop, using the default rotation and scale.

When the roof decoration is added successfully, this method returns true (otherwise, returns false).

Details
Parameters
extrudedStructureGameObject
A map feature GameObject with an Feature.ExtrudedStructure component attached.
roofDecorationPrefab
A Prefab used as a roof decoration. It must have a CircularMarker component attached to it.
marginSize
A value that determines how close a roof decoration can be placed to the edge of the roof.
Exceptions
ArgumentException
Thrown when the extrudedStructure GameObject doesn't have an ExtrudedStructureComponent attached, or when roofDecorationPrefab doesn't have a CircularMarker component attached.
ArgumentException
Thrown when marginSize is negative.