Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 12, 2025

Conversation

BeanCheeseBurrito
Copy link
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.

None yet

1 participant