Class RunAfterAttribute
- Namespace
- KeenEyes
- Assembly
- KeenEyes.Abstractions.dll
Specifies that this system must run after another system.
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)]
[ExcludeFromCodeCoverage]
public sealed class RunAfterAttribute : Attribute
- Inheritance
-
RunAfterAttribute
- Inherited Members
Examples
[System(Phase = SystemPhase.Update)]
[RunAfter(typeof(InputSystem))]
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 after the specified target system.
Multiple RunAfterAttribute 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 after B, B runs after A), an InvalidOperationException is thrown during system sorting.
Constructors
RunAfterAttribute(Type)
Specifies that this system must run after another system.
public RunAfterAttribute(Type targetSystem)
Parameters
targetSystemTypeThe type of system that this system must run after.
Examples
[System(Phase = SystemPhase.Update)]
[RunAfter(typeof(InputSystem))]
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 after the specified target system.
Multiple RunAfterAttribute 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 after B, B runs after 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 after.
public Type TargetSystem { get; }
Property Value
Exceptions
- ArgumentNullException
Thrown when
targetSystemis null.