Class: ULambdaSystem

class SYSTEMS_API ULambdaSystem
    : public USystem;

Reflection-enabled

Specifiers:

  • BlueprintType
  • Blueprintable

Handy wrapper for state-less systems (functions or lambdas).

See USystem

Example

UFUNCTION()
void BoidsFaceDirectionSystem(USystemsWorld& Systems);

void BoidsFaceDirectionSystem(USystemsWorld& Systems)
{
	for (auto& QueryItem : Systems.Query<UVelocityComponent, UBoidComponent>())
	{
		auto* Actor = QueryItem.Get<0>();
		const auto* Velocity = QueryItem.Get<1>();

		if (Velocity->Value.IsNearlyZero() == false)
		{
			Actor->SetActorRotation(Velocity->Value.Rotation());
		}
	}
}
Systems.InstallLambdaSystem(BoidsFaceDirectionSystem, FInstallSystemOptions("BoidsFaceDirection"));

Methods

  • Bind

    public:
    void Bind(
        TFunction<FunctorType>&& Func
    );
    

    Binds given function/lambda that runs some system logic.

    Method called by USystemsWorld::InstallLambdaSystem


    Arguments

    • Func

      TFunction<FunctorType>&& Func
      
  • Unbind

    public:
    void Unbind();
    

    Unbinds stored function/lambda that runs some system logic.


Documentation built with Unreal-Doc v1.0.8 tool by PsichiX