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
Object
ScriptableObject
SpellAsset
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.name
Object.hideFlags

Constructors

SpellAsset()

public SpellAsset()

Fields

area

Optional residual region left at the target point (any kind).

public AreaEffectData area

Field Value

AreaEffectData

castCue

Played when the cast is approved.

public AudioCue castCue

Field Value

AudioCue

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

float

description

Tooltip text.

[TextArea]
public string description

Field Value

string

displayName

Name shown on the spell button; blank uses the asset name.

public string displayName

Field Value

string

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

SpellKind

pointRule

Which target points are accepted.

public PointRuleData pointRule

Field Value

PointRuleData

spellId

Spell id; blank uses the asset name.

public string spellId

Field Value

string

strikes

Strikes dropped by an area-strike spell.

public StrikeData strikes

Field Value

StrikeData

support

Units called by a reinforcement spell.

[Header("Payload")]
public SummonData support

Field Value

SummonData

unlockWave

First wave number in which the spell can be cast (0 = during preparation).

[Min(0)]
public int unlockWave

Field Value

int

Properties

DisplayName

The resolved display name.

public string DisplayName { get; }

Property Value

string

PreviewRadius

Radius of the targeting preview ellipse.

public float PreviewRadius { get; }

Property Value

float

SpellId

The resolved spell id.

public string SpellId { get; }

Property Value

string

Methods

CollectProjectiles(List<ProjectileAsset>)

Adds projectiles used by the spell.

public void CollectProjectiles(List<ProjectileAsset> output)

Parameters

output List<ProjectileAsset>

CollectReferences(List<EntityAssetBase>)

Adds unit templates used by the spell.

public void CollectReferences(List<EntityAssetBase> output)

Parameters

output List<EntityAssetBase>

ToDef()

Bakes the spell definition.

public SpellDef ToDef()

Returns

SpellDef