Class EntityView

Namespace
TDMaker.Unity.View
Assembly
TDMaker.Unity.dll

Pooled visual for one simulation entity: interpolated position, y-sorting, facing, optional health bar, hit flash, death fade, status-effect tint and icons, tower tier pips, projectile trail and orientation, hero death/return presentation, and an optional Animator driven with the standard parameters (Move bool, Speed float, Attack/Hit/Die triggers; missing parameters are skipped). Add it to custom prefabs to control sorting and the body renderer; it is added automatically otherwise.

[AddComponentMenu("2D Tower Defense Maker/Entity View")]
public sealed class EntityView : MonoBehaviour
Inheritance
Object
Component
Behaviour
MonoBehaviour
EntityView
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.didStart
MonoBehaviour.didAwake
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.GetComponentIndex()
Component.CompareTag(TagHandle)
Component.transform
Component.transformHandle
Component.gameObject
Component.tag
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

EntityView()

public EntityView()

Properties

BodyColor

Rendered body colour.

public Color BodyColor { get; }

Property Value

Color

BodySprite

Rendered body sprite (for icons and ghosts), or null.

public Sprite BodySprite { get; }

Property Value

Sprite

ControlBits

Active combat control bits from the last CombatControlChanged event (1 attacks disabled, 2 ignores blocking, 4 untargetable).

public int ControlBits { get; }

Property Value

int

EffectCount

Number of distinct status effects shown.

public int EffectCount { get; }

Property Value

int

EntityId

Bound entity identifier.

public int EntityId { get; }

Property Value

int

FacingLeft

Whether the unit currently faces left (world direction, before the art's native direction is applied).

public bool FacingLeft { get; }

Property Value

bool

Hooks

Presentation hooks of the bound template (may be null).

public PresentationHooks Hooks { get; }

Property Value

PresentationHooks

IsDown

Whether the view shows the unit lying down (same-unit return, before its health comes back).

public bool IsDown { get; }

Property Value

bool

IsDying

Whether the view is fading out after death.

public bool IsDying { get; }

Property Value

bool

IsRising

Whether the view shows the unit rising (same-unit return or a successor / raised unit preparing).

public bool IsRising { get; }

Property Value

bool

IsWaitingForOwner

Whether the view shows a companion waiting for its dead owner (dimmed).

public bool IsWaitingForOwner { get; }

Property Value

bool

Kind

Bound entity role.

public EntityKind Kind { get; }

Property Value

EntityKind

LyingAmount

How far the body is turned onto its side (0 upright, 1 lying).

public float LyingAmount { get; }

Property Value

float

ProjectileAsset

Projectile asset of a bound projectile (null otherwise).

public ProjectileAsset ProjectileAsset { get; }

Property Value

ProjectileAsset

ShieldAmount

Total remaining shield capacity shown on this view (sum of every shield binding).

public float ShieldAmount { get; }

Property Value

float

SplashRadius

Damage radius of a bound projectile (for splash rings); zero for single-target shots.

public float SplashRadius { get; }

Property Value

float

TemplateId

Template id bound to this view, or null for projectiles.

public string TemplateId { get; }

Property Value

string

Methods

GetEffect(int)

Returns the index-th shown status effect (see EffectCount).

public StatusEffectAsset GetEffect(int index)

Parameters

index int

Returns

StatusEffectAsset

TryGetBodyBounds(out Bounds)

The visible body rectangle, excluding health bars, shadows and feedback decorations.

public bool TryGetBodyBounds(out Bounds bounds)

Parameters

bounds Bounds

Returns

bool