Class RunBeforeAttribute
- Namespace
- KeenEyes
- Assembly
- KeenEyes.Abstractions.dll
Specifies that this system must run before another system.
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
[ExcludeFromCodeCoverage]
public sealed class RunBeforeAttribute : Attribute
- Inheritance
-
RunBeforeAttribute
- Inherited Members
Examples
[System(Phase = SystemPhase.Update)]
[RunBefore(typeof(RenderSystem))]
public partial class MovementSystem : SystemBase
{
public override void Update(float deltaTime) { }
}
Remarks
This attribute creates an ordering constraint between systems within the same phase. The system with this attribute will be scheduled to execute before the specified target system.
Multiple RunBeforeAttribute can be applied to the same system to express multiple dependencies. All constraints are resolved using topological sorting.
If the constraints create a cycle (e.g., A runs before B, B runs before A), an InvalidOperationException is thrown during system sorting.
Constructors
RunBeforeAttribute(Type)
Specifies that this system must run before another system.
public RunBeforeAttribute(Type targetSystem)
Parameters
targetSystemTypeThe type of system that this system must run before.
Examples
[System(Phase = SystemPhase.Update)]
[RunBefore(typeof(RenderSystem))]
public partial class MovementSystem : SystemBase
{
public override void Update(float deltaTime) { }
}
Remarks
This attribute creates an ordering constraint between systems within the same phase. The system with this attribute will be scheduled to execute before the specified target system.
Multiple RunBeforeAttribute can be applied to the same system to express multiple dependencies. All constraints are resolved using topological sorting.
If the constraints create a cycle (e.g., A runs before B, B runs before A), an InvalidOperationException is thrown during system sorting.
Exceptions
- ArgumentNullException
Thrown when
targetSystemis null.
Properties
TargetSystem
Gets the type of the system that this system must run before.
public Type TargetSystem { get; }
Property Value
Exceptions
- ArgumentNullException
Thrown when
targetSystemis null.