From 6835f91a092f2fa6d38dafe0d6f324d35903cf94 Mon Sep 17 00:00:00 2001 From: Axen Date: Tue, 22 Apr 2025 05:37:04 +0300 Subject: [PATCH] Docs/hooks set order warning (#220) * Add docs warning about hook set order * Improve warning wording --- docs/learn/concepts/component-traits.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/learn/concepts/component-traits.md b/docs/learn/concepts/component-traits.md index 3b0f1ce..10aa99d 100644 --- a/docs/learn/concepts/component-traits.md +++ b/docs/learn/concepts/component-traits.md @@ -14,6 +14,10 @@ A (component) ID can be marked with `Tag“ in which the component will never con Hooks are part of the "interface" of a component. You could consider hooks as the counterpart to OOP methods in ECS. They define the behavior of a component, but can only be invoked through mutations on the component data. You can only configure a single `OnAdd`, `OnRemove` and `OnSet` hook per component, just like you can only have a single constructor and destructor. +::: warning +Hooks, added to a component that has already been added to other entities/components, will not be called. +::: + ## Examples ::: code-group