starting to add the hud in the sample

This commit is contained in:
Arnaud Jamin
2023-10-06 17:22:23 -04:00
parent 92396410d4
commit b18e62cd02
112 changed files with 707 additions and 333 deletions
+28 -2
View File
@@ -51,6 +51,32 @@ void ACogSamplePlayerController::Tick(float DeltaSeconds)
TArray<AActor*> TagretToIgnore;
FCogSampleTargetAcquisitionResult Result;
TargetAcquisition->FindBestTarget(this, TagretToIgnore, nullptr, true, FVector2D::ZeroVector, false, Result);
Target = Result.Target;
SetTarget(Result.Target);
}
}
}
//--------------------------------------------------------------------------------------------------------------------------
void ACogSamplePlayerController::SetTarget(AActor* Value)
{
if (Value == Target)
{
return;
}
AActor* OldTarget = Target.Get();
Target = Value;
if (GetLocalRole() == ROLE_AutonomousProxy)
{
Server_SetTarget(Value);
}
OnTargetChanged.Broadcast(this, Target.Get(), OldTarget);
}
//--------------------------------------------------------------------------------------------------------------------------
void ACogSamplePlayerController::Server_SetTarget_Implementation(AActor* Value)
{
Target = Value;
}