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
Add World.Create(object[])
#85
Comments
I didn't realize this wasn't a feature until I ran into needing it. I got it working with the following:
Note: The code I'm working on is directly in the |
Working on some more tests now and I realized that using |
When you're running your version of The intent of that function is to be given the array of actual components to be used. The function will create an entity of that archetype and then set the components provided to that entity. I use it fairly heavily in my networking code because that's how I generate the entities client-side. |
Ahhh my goodness thank you! I was using inputting Type instead of object... It seems to work now. |
Discussed in #78
Originally posted by Mathetis April 11, 2023
Hi, I'm curious if the following behavior is by design, if I am misusing it, or if this is a bug.
I have a use case where the array of components arrived as an object[], which contains references to struct components (boxing isn't problematic for my case here). I want to create an entity from those components. Here's a simple example:
We should probably add another
World.Create
overload to create entities by aobject[]
array :)This should be done quickly though.
The text was updated successfully, but these errors were encountered: