Clarify OnAdd hook in cleanup.luau

Add comment to clarify OnAdd hook behavior
This commit is contained in:
Madison 2025-12-07 15:52:52 -08:00 committed by GitHub
parent b30b3910e9
commit a189133d3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,6 +15,7 @@ end)
world:set(Model, jecs.OnAdd, function(entity, id, model)
-- OnAdd is invoked after the data has been assigned.
-- This hook only fires the first time the component is added.
-- It also returns the data for faster access.
-- There may be some logic to do some side effects on reassignments
model:SetAttribute("entityId", entity)