class UCustomISMC : public UInstancedStaticMeshComponent
{
//
void BeginBatchUpdate()
{
check(IsInGameThread());
}
void EndBatchUpdate(bool bMarkRenderStateDirty = false)
{
check(IsInGameThread());
Modify();
// Request navigation update - Execute on a single index as it updates everything anyway
PartialNavigationUpdate(0);
// Force recreation of the render data when proxy is created
InstanceUpdateCmdBuffer.Edit();
if (bMarkRenderStateDirty)
MarkRenderStateDirty();
}
void UsamgeExample()
{
BeginBatchUpdate();
ParallelFor(PerInstanceSMData.Num(), [=](int Index) {
this->PerInstanceSMData[Index].Transform.AddToTranslation(FVector(100, 0, 0));
});
EndBatchUpdate();
}
};