浏览代码

[ue4] Closes #1993, don't generate collision meshes in editor.

badlogic 3 年之前
父节点
当前提交
614b2749f7

+ 1 - 0
spine-ue4/Config/DefaultEngine.ini

@@ -69,4 +69,5 @@ r.DefaultFeature.AmbientOcclusionStaticFraction=False
 r.DefaultFeature.AutoExposure=False
 r.UsePreExposure=False
 r.DefaultFeature.MotionBlur=False
+r.TextureStreaming=False
 

+ 9 - 1
spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp

@@ -157,7 +157,15 @@ void USpineSkeletonRendererComponent::Flush(int &Idx, TArray<FVector> &Vertices,
 	if (Vertices.Num() == 0) return;
 	SetMaterial(Idx, Material);
 
-	CreateMeshSection(Idx, Vertices, Indices, Normals, Uvs, Colors, TArray<FProcMeshTangent>(), bCreateCollision);
+	bool bShouldCreateCollision = false;
+	if (bCreateCollision) {
+		UWorld* world = GetWorld();
+		if (world && world->IsGameWorld()) {
+			bShouldCreateCollision = true;
+		}
+	}
+	
+	CreateMeshSection(Idx, Vertices, Indices, Normals, Uvs, Colors, TArray<FProcMeshTangent>(), bShouldCreateCollision);
 
 	Vertices.SetNum(0);
 	Indices.SetNum(0);