Class SpellAsset
- Namespace
- TDMaker.Unity.Authoring
- Assembly
- TDMaker.Unity.dll
A player spell with a cooldown and a target point. Bakes to SpellDef; list it in spells. The point rule is shared by the HUD preview and the cast command.
[CreateAssetMenu(menuName = "2D Tower Defense Maker/Spell", fileName = "Spell", order = 16)]
public sealed class SpellAsset : ScriptableObject
- Inheritance
-
ObjectScriptableObjectSpellAsset
- 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
SpellAsset()
public SpellAsset()
Fields
area
Optional residual region left at the target point (any kind).
public AreaEffectData area
Field Value
castCue
Played when the cast is approved.
public AudioCue castCue
Field Value
castVfx
Optional pooled VFX spawned at the cast point.
public GameObject castVfx
Field Value
- GameObject
color
Button and preview colour.
public Color color
Field Value
- Color
cooldown
Cooldown in game seconds, consumed only by an approved cast.
[Min(0)]
public float cooldown
Field Value
description
Tooltip text.
[TextArea]
public string description
Field Value
displayName
Name shown on the spell button; blank uses the asset name.
public string displayName
Field Value
icon
Optional button icon; a generated emblem is used when empty.
public Sprite icon
Field Value
- Sprite
kind
Main payload.
[Header("Rules")]
public SpellKind kind
Field Value
pointRule
Which target points are accepted.
public PointRuleData pointRule
Field Value
spellId
Spell id; blank uses the asset name.
public string spellId
Field Value
strikes
Strikes dropped by an area-strike spell.
public StrikeData strikes
Field Value
support
Units called by a reinforcement spell.
[Header("Payload")]
public SummonData support
Field Value
unlockWave
First wave number in which the spell can be cast (0 = during preparation).
[Min(0)]
public int unlockWave
Field Value
Properties
DisplayName
The resolved display name.
public string DisplayName { get; }
Property Value
PreviewRadius
Radius of the targeting preview ellipse.
public float PreviewRadius { get; }
Property Value
SpellId
The resolved spell id.
public string SpellId { get; }
Property Value
Methods
CollectProjectiles(List<ProjectileAsset>)
Adds projectiles used by the spell.
public void CollectProjectiles(List<ProjectileAsset> output)
Parameters
outputList<ProjectileAsset>
CollectReferences(List<EntityAssetBase>)
Adds unit templates used by the spell.
public void CollectReferences(List<EntityAssetBase> output)
Parameters
outputList<EntityAssetBase>
ToDef()
Bakes the spell definition.
public SpellDef ToDef()