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
-
ObjectScriptableObjectEnemyAsset
- 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
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
behavior
Always-on action channels (for example a periodic heal or shield cast on nearby allies).
public List<AbilityActionData> behavior
Field Value
blockable
Whether soldiers can block this unit.
public bool blockable
Field Value
blockerCapacity
Maximum soldiers that can engage this unit at once.
[Min(0)]
public int blockerCapacity
Field Value
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
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
engagement
Where blockers stand around this unit (horizontal gap share, Y shift, row spacing).
public EngagementHostData engagement
Field Value
flying
Flying units ignore blocking and attacks that cannot hit flyers.
public bool flying
Field Value
gold
Gold awarded on death.
[Min(0)]
public int gold
Field Value
health
Maximum hit points.
[Min(1)]
public float health
Field Value
lifeCost
Lives lost when this unit escapes.
[Min(0)]
public int lifeCost
Field Value
magicalArmor
Magical damage reduction in [0, 1].
[Range(0, 1)]
public float magicalArmor
Field Value
melee
Melee attack used against blocking soldiers.
public MeleeData melee
Field Value
meleeEvasion
Chance to avoid each melee strike.
[Range(0, 1)]
public float meleeEvasion
Field Value
physicalArmor
Physical damage reduction in [0, 1].
[Range(0, 1)]
public float physicalArmor
Field Value
poisonArmor
Poison damage reduction in [0, 1].
[Range(0, 1)]
public float poisonArmor
Field Value
rangedAttacks
Optional ranged attacks against soldiers.
public List<RangedAttackData> rangedAttacks
Field Value
reflection
Returns a share of the health this unit actually loses to its attacker (thorns).
public ReflectionData reflection
Field Value
regeneration
Optional health regeneration (keep "idle only" off for enemies).
[Header("Abilities")]
public RecoveryData regeneration
Field Value
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
speed
Movement speed in world units per second.
[Min(0)]
public float speed
Field Value
statusImmunities
Status effect ids or families this unit ignores.
public List<string> statusImmunities
Field Value
tags
Author-defined tag bits matched by effect and mechanic eligibility (Required/Rejected Tags).
[Header("Mechanics")]
public int tags
Field Value
Methods
BuildTemplate()
Builds the unresolved core template.
public override EntityTemplate BuildTemplate()
Returns
CollectProjectiles(List<ProjectileAsset>)
Adds projectile assets used by this asset's attacks.
public override void CollectProjectiles(List<ProjectileAsset> output)
Parameters
outputList<ProjectileAsset>
CollectReferences(List<EntityAssetBase>)
Adds other entity assets this asset references (upgrades, soldiers).
public override void CollectReferences(List<EntityAssetBase> output)
Parameters
outputList<EntityAssetBase>