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
-
ObjectComponentBehaviourMonoBehaviourEntityView
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.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.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.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
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
EffectCount
Number of distinct status effects shown.
public int EffectCount { get; }
Property Value
EntityId
Bound entity identifier.
public int EntityId { get; }
Property Value
FacingLeft
Whether the unit currently faces left (world direction, before the art's native direction is applied).
public bool FacingLeft { get; }
Property Value
Hooks
Presentation hooks of the bound template (may be null).
public PresentationHooks Hooks { get; }
Property Value
IsDown
Whether the view shows the unit lying down (same-unit return, before its health comes back).
public bool IsDown { get; }
Property Value
IsDying
Whether the view is fading out after death.
public bool IsDying { get; }
Property Value
IsRising
Whether the view shows the unit rising (same-unit return or a successor / raised unit preparing).
public bool IsRising { get; }
Property Value
IsWaitingForOwner
Whether the view shows a companion waiting for its dead owner (dimmed).
public bool IsWaitingForOwner { get; }
Property Value
Kind
Bound entity role.
public EntityKind Kind { get; }
Property Value
LyingAmount
How far the body is turned onto its side (0 upright, 1 lying).
public float LyingAmount { get; }
Property Value
ProjectileAsset
Projectile asset of a bound projectile (null otherwise).
public ProjectileAsset ProjectileAsset { get; }
Property Value
ShieldAmount
Total remaining shield capacity shown on this view (sum of every shield binding).
public float ShieldAmount { get; }
Property Value
SplashRadius
Damage radius of a bound projectile (for splash rings); zero for single-target shots.
public float SplashRadius { get; }
Property Value
TemplateId
Template id bound to this view, or null for projectiles.
public string TemplateId { get; }
Property Value
Methods
GetEffect(int)
Returns the index-th shown status effect (see EffectCount).
public StatusEffectAsset GetEffect(int index)
Parameters
indexint
Returns
TryGetBodyBounds(out Bounds)
The visible body rectangle, excluding health bars, shadows and feedback decorations.
public bool TryGetBodyBounds(out Bounds bounds)
Parameters
boundsBounds