Skip to content

Is there an event that fires when a System is activated/added? #13

Answered by player-03
NitroPlum asked this question in Q&A
Discussion options

You must be logged in to vote
class MySystem extends System {
	public function new() {
		onActivate.add(() -> trace("MySystem activated"));
		onDeactivate.add(() -> trace("MySystem deactivated"));
	}
}

Also note that once activated, the system will receive any pending @:add events all at once. This is meant to help you worry less about initialization order. You'll get the event regardless of whether the entity or the system is created first.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by NitroPlum
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