Class AbstractSpriteIcon
Icon for a minimap composed of a simple sprite.
Implements
Namespace: nickmaltbie.MinimapTools.Icon
Assembly: cs.temp.dll.dll
Syntax
public abstract class AbstractSpriteIcon : MonoBehaviour, IMinimapIcon
Fields
rotateIcon
Should the icon rotate with the object's rotation.
Declaration
public bool rotateIcon
Field Value
Type | Description |
---|---|
Boolean |
sprite
Icon for this object on the minimap.
Declaration
public Sprite sprite
Field Value
Type | Description |
---|---|
Sprite |
Methods
CreateIcon(IMinimap, RectTransform)
Create an icon to represent this object on the minimap.
Declaration
public GameObject CreateIcon(IMinimap minimap, RectTransform minimapTransform)
Parameters
Type | Name | Description |
---|---|---|
IMinimap | minimap | Reference to minimap this icon will be added to, useful for scaling and manipulating the icon |
RectTransform | minimapTransform | Transform of the parent minimap this is being added to. |
Returns
Type | Description |
---|---|
GameObject | The newly created icon for this object. |
GetIconRotation()
Get the rotation of the object in world space.
Declaration
public Quaternion GetIconRotation()
Returns
Type | Description |
---|---|
Quaternion | The current rotation of the object in world space. |
GetPixelSize(IMinimap)
Size of the icon in pixels.
Declaration
public abstract Vector2Int GetPixelSize(IMinimap minimap)
Parameters
Type | Name | Description |
---|---|---|
IMinimap | minimap | Minimap the icon will be drawn on. May affect the size of the icon. |
Returns
Type | Description |
---|---|
Vector2Int | Size of the icon in pixels. |
GetWorldSize()
If this element scales with the map size, this will scale the element to be larger or smaller based on its world size.
Declaration
public virtual Vector2 GetWorldSize()
Returns
Type | Description |
---|---|
Vector2 | Size of the object in world units. |
GetWorldSpace()
Get the location of this object in world space.
Declaration
public Vector3 GetWorldSpace()
Returns
Type | Description |
---|---|
Vector3 | Position of the object in world space. |
RotateWithMap()
Should the element rotate with the map.
Declaration
public bool RotateWithMap()
Returns
Type | Description |
---|---|
Boolean | True if the element should rotate with the map, false otherwise. |
ScaleWithMap()
Should the icon scale with the map scale.
Declaration
public abstract bool ScaleWithMap()
Returns
Type | Description |
---|---|
Boolean | If true, will scale with the map, if false will not scale with the map. |