Class EnemyAsset

Namespace
TDMaker.Unity.Authoring
Assembly
TDMaker.Unity.dll

A path-following hostile unit.

[CreateAssetMenu(menuName = "2D Tower Defense Maker/Enemy", fileName = "Enemy", order = 10)]
public sealed class EnemyAsset : EntityAssetBase
Inheritance
Object
ScriptableObject
EnemyAsset
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

EnemyAsset()

public EnemyAsset()

Fields

aura

Optional region emitted when the unit appears. Turn on Until Source Lost (and Follow Source) for a permanent aura.

public AreaEffectData aura

Field Value

AreaEffectData

behavior

Always-on action channels (for example a periodic heal or shield cast on nearby allies).

public List<AbilityActionData> behavior

Field Value

List<AbilityActionData>

blockable

Whether soldiers can block this unit.

public bool blockable

Field Value

bool

blockerCapacity

Maximum soldiers that can engage this unit at once.

[Min(0)]
public int blockerCapacity

Field Value

int

deathSuccession

Successor rules for deathSummon: chain budget, rise time and bounty policy.

[Tooltip("Successor rules for the enemies released on death: how many releases the lineage may make, their rise time and who may pay the bounty.")]
public DeathSuccessionData deathSuccession

Field Value

DeathSuccessionData

deathSummon

Optional enemies released where this unit dies (splitting); assign an EnemyAsset as the unit.

[Tooltip("Optional enemies released where this unit dies (splitting). Assign an Enemy as the unit; they continue along the path.")]
public SummonData deathSummon

Field Value

SummonData

engagement

Where blockers stand around this unit (horizontal gap share, Y shift, row spacing).

public EngagementHostData engagement

Field Value

EngagementHostData

flying

Flying units ignore blocking and attacks that cannot hit flyers.

public bool flying

Field Value

bool

gold

Gold awarded on death.

[Min(0)]
public int gold

Field Value

int

health

Maximum hit points.

[Min(1)]
public float health

Field Value

float

lifeCost

Lives lost when this unit escapes.

[Min(0)]
public int lifeCost

Field Value

int

magicalArmor

Magical damage reduction in [0, 1].

[Range(0, 1)]
public float magicalArmor

Field Value

float

melee

Melee attack used against blocking soldiers.

public MeleeData melee

Field Value

MeleeData

meleeEvasion

Chance to avoid each melee strike.

[Range(0, 1)]
public float meleeEvasion

Field Value

float

physicalArmor

Physical damage reduction in [0, 1].

[Range(0, 1)]
public float physicalArmor

Field Value

float

poisonArmor

Poison damage reduction in [0, 1].

[Range(0, 1)]
public float poisonArmor

Field Value

float

rangedAttacks

Optional ranged attacks against soldiers.

public List<RangedAttackData> rangedAttacks

Field Value

List<RangedAttackData>

reflection

Returns a share of the health this unit actually loses to its attacker (thorns).

public ReflectionData reflection

Field Value

ReflectionData

regeneration

Optional health regeneration (keep "idle only" off for enemies).

[Header("Abilities")]
public RecoveryData regeneration

Field Value

RecoveryData

revive

Same-unit return on the spot: it lies down, gets a share of its health back and rises.

[Tooltip("Same-unit return on the spot: it lies down, gets a share of its health back and rises (the bounty is paid once).")]
public ReviveData revive

Field Value

ReviveData

speed

Movement speed in world units per second.

[Min(0)]
public float speed

Field Value

float

statusImmunities

Status effect ids or families this unit ignores.

public List<string> statusImmunities

Field Value

List<string>

tags

Author-defined tag bits matched by effect and mechanic eligibility (Required/Rejected Tags).

[Header("Mechanics")]
public int tags

Field Value

int

Methods

BuildTemplate()

Builds the unresolved core template.

public override EntityTemplate BuildTemplate()

Returns

EntityTemplate

CollectProjectiles(List<ProjectileAsset>)

Adds projectile assets used by this asset's attacks.

public override void CollectProjectiles(List<ProjectileAsset> output)

Parameters

output List<ProjectileAsset>

CollectReferences(List<EntityAssetBase>)

Adds other entity assets this asset references (upgrades, soldiers).

public override void CollectReferences(List<EntityAssetBase> output)

Parameters

output List<EntityAssetBase>