void UDestructibleComponent::OnDamageEvent(const NxApexDamageEventReportData& InDamageEvent)
{
	SpawnFractureEffectsFromDamageEvent(InDamageEvent);

	// After receiving damage, no longer receive decals.
	if (bReceivesDecals)
	{
		bReceivesDecals = false;
		MarkRenderStateDirty();
	}
}
Пример #2
0
void UDestructibleComponent::OnDamageEvent(const NxApexDamageEventReportData& InDamageEvent)
{
	FVector HitPosition = P2UVector(InDamageEvent.hitPosition);
	FVector HitDirection = P2UVector(InDamageEvent.hitDirection);

	OnComponentFracture.Broadcast(HitPosition, HitDirection);
	if (ADestructibleActor * DestructibleActor = Cast<ADestructibleActor>(GetOwner()))
	{
		DestructibleActor->OnActorFracture.Broadcast(HitPosition, HitDirection);
	}

	SpawnFractureEffectsFromDamageEvent(InDamageEvent);

	// After receiving damage, no longer receive decals.
	if (bReceivesDecals)
	{
		bReceivesDecals = false;
		MarkRenderStateDirty();
	}
}