Skip to content

Behavior.Entity Property

Definition

Namespace: Brine2D.ECS

The entity this behavior is attached to.

C#
public Brine2D.ECS.Entity Entity { get; internal set; }

Property Value

Entity

Remarks

Throws System.InvalidOperationException if accessed after the behavior has been detached via RemoveBehavior<T>(), after the owning entity has been destroyed, or before the behavior has been attached at all. Avoid caching this value or accessing it from outside the normal Update/FixedUpdate/Render lifecycle \(e\.g\., from event callbacks\) without first confirming the behavior is still attached.