Skip to content

Repeat systems #8614

Answered by TimJentzsch
jim-ec asked this question in Q&A
May 14, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

This depends on multiple factors:

  • Do you want to repeat the system's functionality within a frame or for a defined number of frames?
  • Is the number of repetitions fixed once the app has been constructed or could it change every frame?
  • Which part of your app should be able to modify the number of repetitions?

For example, if you want to repeat the system's functionality within a frame, have the number of repetitions be variable and modified by other systems in your app, I would do the following:

  • Introduce a Resource struct wrapping usize to define the repetition count:

    #[derive(Resource)]
    struct RepetitionCount(usize);
  • Initialize the resource to the count you want to start with.

  • Mod…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jim-ec
Comment options

Answer selected by jim-ec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants