public void Execute(Entity ent, int idx, [ReadOnly] ref Translation trans) { if (BoundUtil.IsOutOfBounds(bounds, trans.Value.x, trans.Value.y)) { commandBuffer.DestroyEntity(idx, ent); } }
public void Execute(Entity ent, int idx, [ReadOnly] ref Translation pos) { if (idx == 0) { BoundUtil.DefaultBounds(bounds); } BoundUtil.UpdateBounds(pos, bounds); }
public void Execute(ref Translation trans) { if (BoundUtil.IsAboveTop(bounds, trans.Value.y)) { trans.Value.y = BoundUtil.Top(bounds); } if (BoundUtil.IsBelowBottom(bounds, trans.Value.y)) { trans.Value.y = BoundUtil.Bottom(bounds); } if (BoundUtil.IsAboveRight(bounds, trans.Value.x)) { trans.Value.x = BoundUtil.Right(bounds); } if (BoundUtil.IsBelowLeft(bounds, trans.Value.x)) { trans.Value.x = BoundUtil.Left(bounds); } }
public void Execute(Entity ent, int idx, [ReadOnly] ref Translation trans, [ReadOnly] ref BoundMarkerConvert convert) { if (!BoundUtil.IsOutOfBounds(bounds, trans.Value.x, trans.Value.y)) { commandBuffer.RemoveComponent(idx, ent, typeof(BoundMarkerConvert)); // add new marker switch (convert.newMarker) { case InteractionType.KeepIn: commandBuffer.AddComponent(idx, ent, new BoundMarkerIn()); break; case InteractionType.DeleteOutside: commandBuffer.AddComponent(idx, ent, new BoundMarkerDelete()); break; } } }