Class ArtSet
- Namespace
- TDMaker.Unity.View
- Assembly
- TDMaker.Unity.dll
A swappable set of sprites keyed by view key (template view keys and projectile view keys). Assign one to an
EntityViewRegistry to draw units, towers and projectiles with these sprites instead of the generated
primitives; anything without an entry keeps its prefab or primitive look, so partial sets are fine. Swapping the asset
swaps the whole look without code changes. Also carries the build plot sprite drawn by LevelView.
Create one with Assets/Create/2D Tower Defense Maker/Art Set.
[CreateAssetMenu(menuName = "2D Tower Defense Maker/Art Set", fileName = "ArtSet", order = 41)]
public sealed class ArtSet : ScriptableObject
- Inheritance
-
ObjectScriptableObjectArtSet
- Inherited Members
-
ScriptableObject.SetDirty()ScriptableObject.CreateInstance<T>()Object.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.FindObjectsByType<T>()Object.FindObjectsByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Constructors
ArtSet()
public ArtSet()
Fields
buildSlot
[Header("Level")]
[Tooltip("Empty build plot sprite (pivot at the plot centre). Empty keeps the generated stone pad.")]
public Sprite buildSlot
Field Value
- Sprite
buildSlotScale
[Min(0.01)]
public float buildSlotScale
Field Value
drawBuildSlots
[Tooltip("Draw a marker on every build slot. Turn off when the painted map already shows the plots.")]
public bool drawBuildSlots
Field Value
entries
Entries by view key.
public List<ArtSet.Entry> entries
Field Value
healthBarBack
[Header("Health bars (optional)")]
[Tooltip("Health bar frame drawn behind the fill. Empty keeps the generated bar.")]
public Sprite healthBarBack
Field Value
- Sprite
healthBarFill
[Tooltip("Health bar fill (stretched horizontally with the remaining health).")]
public Sprite healthBarFill
Field Value
- Sprite
healthBarInset
[Tooltip("Inset of the fill inside the frame, as a fraction of the bar width and height.")]
public Vector2 healthBarInset
Field Value
- Vector2
healthBarLow
[Tooltip("Fill used below a third of the health. Empty tints the normal fill.")]
public Sprite healthBarLow
Field Value
- Sprite
Methods
TryGet(string, out Entry)
Finds the entry for a view key (entries without a sprite are ignored).
public bool TryGet(string viewKey, out ArtSet.Entry entry)