Skip to content

Entity.TryGetBehavior(T) Method

Definition

Namespace: Brine2D.ECS

Gets a behavior of the specified type and returns whether it was found. Performs a single linear scan, avoiding the double-scan of HasBehavior<T>() followed by GetBehavior<T>().

C#
public bool TryGetBehavior<T>(out T? behavior)
    where T : Brine2D.ECS.Behavior;

Type parameters

T

Parameters

behavior T

Returns

System.Boolean