Batching Systems Plugin
How do I use it?
Using struct based components
public class BatchedMovementSystem : BatchedSystem<PositionComponent, MovementSpeedComponent>
{
public BatchedMovementSystem(IComponentDatabase componentDatabase, IComponentTypeLookup componentTypeLookup, IBatchBuilderFactory batchBuilderFactory, IThreadHandler threadHandler) : base(componentDatabase, componentTypeLookup, batchBuilderFactory, threadHandler)
{}
protected override IObservable<bool> ReactWhen()
{ return Observable.Interval(TimeSpan.FromSeconds(0.5f)).Select(x => true); }
protected override void Process(int entityId, ref PositionComponent positionComponent, ref MovementSpeedComponent movementSpeedComponent)
{
positionComponent.Position += Vector3.One * movementSpeedComponent.Speed;
}
}Using class based components
Last updated
Was this helpful?