-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
Remove auto reset from Command Buffer PlayBack()
method
#205
Comments
PlayBack()
method
So you mean that it would be a usefull feature to record certain entities once and play them back on a regular basis? ^^ |
Yes. I thought it was designed something like:
For example that's how I use it right now with next code snippet:
// 1. Configure Archetype
// 2. Override Configure method to set up component data, using buffer
// 3. Use Init to execute creation
public abstract class EntityTemplate
{
private readonly CommandBuffer _buffer;
protected abstract ComponentType[] Template { get; }
protected EntityTemplate(World world)
{
_buffer = new CommandBuffer(world);
}
protected abstract void Configure(CommandBuffer buffer, in Entity entity);
public Entity Init()
{
Entity entity = _buffer.Create(Template);
Configure(_buffer, entity);
_buffer.Playback();
return entity;
}
} In the Does that makes sense? :D |
Kinda, well it makes sense to add an way to permit the reset each playback ^^ I would really appreciate a pr for this :) Oh and there's also : #21 which solves the problem differently |
Sure, I will make a pr when I will get my hands on. |
Was introduced in 5f5b058 |
After
PlayBack()
method command buffer auto dispose everything user recorded. Its great for cases where you preventNullRefs
.But, what if, it would be optional choice? What about only creational command buffers?
When I was looking at #21 I tried to code sample solution, using command buffer. With this reset, user have to re-record the same steps, to do the same thing
For example:
The text was updated successfully, but these errors were encountered: