Contents

dependencies

An array of dependencies for this system.

Declaration

static var dependencies: [SystemDependency] { get }

Mentioned in

Discussion

If you need to specify the update order between your system and other systems in your app, you can do that using this property. If your system has no dependencies, you don’t need to declare this property. RealityKit provides a default implementation for systems with no dependencies.

Here’s an example where one other system updates before this system, and another system updates after it.

class SystemB : RealityKit.System {
    static var dependencies: [SystemDependency] {
        [.after(SystemA.self),        // Run SystemB after SystemA.
         .before(SystemC.self)]       // Run SystemB before SystemC.
     }
    // ...
}

When the app runs, RealityKit calls update(context:) on SystemA first, then on SystemB, and then on SystemC.

See Also

Specifying dependencies