Crosshairs are now only visible when nothing is hit by the line trace, to further improve visibility.
This commit is contained in:
parent
da81ee271e
commit
1d15350610
Binary file not shown.
@ -94,17 +94,18 @@ void ABugPlacerPawn::TraceTimerElapsed()
|
||||
if (ABugMarkerActor *Marker = Cast<ABugMarkerActor>(TraceHit.GetActor()))
|
||||
{
|
||||
this->PlacementMarkerRoot->SetVisibility(true, false);
|
||||
this->ShowDummyMarker(false);
|
||||
this->UpdateBugInformation(Marker->GetBugData());
|
||||
this->ShowDummyMarker(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->PlacementMarkerRoot->SetVisibility(true, true);
|
||||
this->ShowDummyMarker(true);
|
||||
this->UpdateBugInformation(FJSONBugData());
|
||||
this->ShowDummyMarker(true);
|
||||
}
|
||||
|
||||
this->PlacementMarkerRoot->SetWorldLocationAndRotation(TraceHit.ImpactPoint, FRotationMatrix::MakeFromZ(TraceHit.ImpactNormal).ToQuat());
|
||||
this->ShowCrosshairs(false);
|
||||
|
||||
const FVector TraceOriginLocation = this->TraceOriginComponent->GetComponentLocation();
|
||||
FVector FacingVector = (TraceHit.ImpactPoint - TraceOriginLocation);
|
||||
@ -118,6 +119,7 @@ void ABugPlacerPawn::TraceTimerElapsed()
|
||||
{
|
||||
this->PlacementMarkerRoot->SetRelativeLocationAndRotation(FVector::ZeroVector, FRotator::ZeroRotator);
|
||||
this->PlacementMarkerRoot->SetVisibility(false, true);
|
||||
this->ShowCrosshairs(true);
|
||||
|
||||
const FVector TraceOriginLocation = this->TraceOriginComponent->GetComponentLocation();
|
||||
FVector FacingVector = (TraceEnd - TraceOriginLocation);
|
||||
|
||||
@ -30,6 +30,8 @@ public:
|
||||
void UpdateBugInformation(const FJSONBugData &BugData);
|
||||
UFUNCTION(BlueprintImplementableEvent)
|
||||
void ShowDummyMarker(const bool bShow);
|
||||
UFUNCTION(BlueprintImplementableEvent)
|
||||
void ShowCrosshairs(const bool bShow);
|
||||
|
||||
UFUNCTION(BlueprintCallable, meta=(WorldContext="WorldContextObject"))
|
||||
static void SpawnBugPlacerPawn(const UObject *WorldContextObject, TSubclassOf<ABugPlacerPawn> Class);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user