using UnityEngine; using System; using TMPro; namespace WPM { [Serializable] public class CountryDecorator { /// /// The name of the country which is being decorated. /// public string countryName; /// /// If country is completely hidden. /// public bool hidden = false; /// /// Custom label that replaces region name /// public string customLabel = ""; /// /// The fill color /// public Color fillColor = Color.white; /// /// If the region is colorized with fillColor. /// public bool isColorized; /// /// If the label has its own color different from general property. /// public bool labelOverridesColor; /// /// Optional label color (labelOverridesColor must be true to have effect) /// public Color labelColor = Color.yellow; /// /// If the label has its own scale. /// public bool labelOverridesSize; /// /// Optional label size (labelOverridesSize must be true to have effect) /// public float labelSize = 0.1f; /// /// Whether the country label will be printed or not. /// public bool labelVisible = true; /// /// Manual offset of the label with respect to the country center. Setting this value to different than zero will make this country ignore auto-positioning. /// public Vector2 labelOffset = Misc.Vector2zero; /// /// Manual rotation of the label in degrees. Setting this value to different than zero will force the label to be rotated to the specified degree. /// public float labelRotation = 0; /// /// Optional texture /// public Texture2D texture; /// /// The texture offset. /// public Vector2 textureOffset = Misc.Vector2zero; /// /// The texture scale. /// public Vector2 textureScale = Misc.Vector2one; /// /// The texture rotation. Note that applying a rotation will add some performance overhead during preparation of the material but not afterwards. /// public float textureRotation = 0; /// /// Optional font for the label /// public Font labelFontOverride; /// /// Optional font for the label (Text Mesh Pro) /// public TMP_FontAsset labelFontTMProOverride; /// /// Optional font material preset (Text Mesh Pro) /// public Material labelFontTMProMaterialOverride; /// /// Internally used for decorators which have not been assigned yet. /// [HideInInspector] public bool isNew = true; public CountryDecorator() { } public CountryDecorator(string countryName) { this.countryName = countryName; } public void Reset() { customLabel = ""; labelOverridesColor = false; isColorized = false; labelFontOverride = null; labelFontTMProOverride = null; labelFontTMProMaterialOverride = null; labelOffset = Misc.Vector2zero; labelRotation = 0; labelVisible = true; hidden = false; } } }