Skip to content

Use in modifier for .Set() and .SetAutoOverride()#89

Merged
BeanCheeseBurrito merged 1 commit intomainfrom
set-parameter-modifiers
Mar 12, 2025
Merged

Use in modifier for .Set() and .SetAutoOverride()#89
BeanCheeseBurrito merged 1 commit intomainfrom
set-parameter-modifiers

Conversation

@BeanCheeseBurrito
Copy link
Copy Markdown
Owner

All .Set() and .SetAutoOverride() overloads have been changed to use the in parameter modifier to pass in component data.

Below are all valid ways of setting components.

Position position = new Position(1, 2);

Entity entity = world.Entity();
entity.Set(position);     // Pass by value.
entity.Set(in position);  // Pass by in reference.
entity.Set(ref position); // Pass by ref reference but a warning is issued.

@BeanCheeseBurrito BeanCheeseBurrito merged commit fcdc866 into main Mar 12, 2025
6 checks passed
@BeanCheeseBurrito BeanCheeseBurrito deleted the set-parameter-modifiers branch March 17, 2025 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant