diff --git a/Source/RuntimeMeshComponent/Private/Components/RuntimeMeshComponentStatic.cpp b/Source/RuntimeMeshComponent/Private/Components/RuntimeMeshComponentStatic.cpp index 0f14a4a..747b73f 100644 --- a/Source/RuntimeMeshComponent/Private/Components/RuntimeMeshComponentStatic.cpp +++ b/Source/RuntimeMeshComponent/Private/Components/RuntimeMeshComponentStatic.cpp @@ -22,6 +22,7 @@ void URuntimeMeshComponentStatic::OnRegister() else { Initialize(StaticProvider); + RuntimeMesh = GetRuntimeMesh(); } Super::OnRegister(); diff --git a/Source/RuntimeMeshComponent/Private/RuntimeMesh.cpp b/Source/RuntimeMeshComponent/Private/RuntimeMesh.cpp index 67c9d21..fb65910 100644 --- a/Source/RuntimeMeshComponent/Private/RuntimeMesh.cpp +++ b/Source/RuntimeMeshComponent/Private/RuntimeMesh.cpp @@ -1149,9 +1149,9 @@ FRuntimeMeshProxyPtr URuntimeMesh::GetRenderProxy(ERHIFeatureLevel::Type InFeatu for (int32 LODIndex = 0; LODIndex < LODs.Num(); LODIndex++) { FRuntimeMeshLOD& LOD = LODs[LODIndex]; - for (int32 SectionId = 0; SectionId < LOD.Sections.Num(); SectionId++) + for (auto pair : LOD.Sections) { - RenderProxy->CreateOrUpdateSection_GameThread(LODIndex, SectionId, LOD.Sections[SectionId], true); + RenderProxy->CreateOrUpdateSection_GameThread(LODIndex, pair.Key, pair.Value, true); bHadAnyInitialized = true; }