This component is used to decorate parts of the map. Current decorator version supports:
-
Customizing the label of a country
-
Colorize a country with a custom color
-
Assign a texture to a country, with scale, offset and rotation options.
You may use this component in two ways:
-
From the Editor, clicking on the “Open Decorator” button at the bottom of the World Map inspector.
-
From code, using any of its API through map.decorator accessor. The first time you use its API, it will automatically add the component to the map gameObject.
The API of this component has several methods but the most important are:
map.decorator.SetCountryDecorator(int groupIndex, string countryName, CountryDecorator decorator)
This will assign a decorator to specified country. Decorators are objects that contains customization options and belong to one of the existing groups. This way you can enable/disable a group and all decorators of that group will be enabled/disabled at once (for instance, you may group several countries in the same group).
map.decorator.RemoveCountryDecorator(int groupIndex, string countryName
This method will remove a decorator from the group and its effects will be removed.
A decorator object has the following fields:
- countryName: the name of the country to be decorated. It will be assigned automatically when using SetCountryDecorator method.
- hidden: hides the country, including the region and label.
- persistent: when enabled, the decorator settings will be checked every 10th frames and will replace any other appearance change on the country.
- customLabel: leave it as “” to preserve current country label.
- isColorized: if the country is colorized.
- fillColor: the colorizing color.
- labelOverridesColor: if the color of the label is specified.
- labelColor: the color of the label.
- labelVisible: if the label is visible (default = true);
- labelOffset: horizontal and vertical position offset of the label relative to the center of the country.
- labelRotation: rotation of the label in degrees.
- texture: the texture to assign to the country.
- textureScale, textureOffset and textureRotation allows to tweak how the texture is mapped to the surface.