I have a component that inherits from Drawable. I have added methods to resize the batch count, but it doesn’t seem to work correctly. For example if I create two components and resize the batches accordingly and set the index of the first to 0 and the second to 1 if I apply a different material on both the second overwrites the first. What would be the correct way of doing this?
batches_.Resize(batchCount_);
batches_[batchIndex_].geometry_ = geometry_;
batches_[batchIndex_].material_ = material;