mirror of
https://github.com/Ed94/Cog.git
synced 2026-06-13 08:02:23 -07:00
starting to add the hud in the sample
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user