--------------------------------------------------------------------------------------------------------------------------
| 147 | |
| 148 | //-------------------------------------------------------------------------------------------------------------------------- |
| 149 | void ACogSamplePlayerController::TickTargeting(float DeltaSeconds) |
| 150 | { |
| 151 | if (IsLocalController()) |
| 152 | { |
| 153 | if (TargetAcquisition == nullptr) |
| 154 | { |
| 155 | SetTarget(nullptr); |
| 156 | return; |
| 157 | } |
| 158 | |
| 159 | TArray<AActor*> TargetToIgnore; |
| 160 | FCogSampleTargetAcquisitionResult Result; |
| 161 | TargetAcquisition->FindBestTarget(this, TargetToIgnore, nullptr, true, FVector2D::ZeroVector, false, Result); |
| 162 | SetTarget(Result.Target); |
| 163 | } |
| 164 | |
| 165 | #if ENABLE_COG |
| 166 | if (Target != nullptr && PossessedCharacter != nullptr) |
| 167 | { |
| 168 | FCogDebugDraw::Segment(LogCogTargetAcquisition, this, PossessedCharacter->GetActorLocation(), Target->GetActorLocation(), FColor::White, false); |
| 169 | } |
| 170 | #endif //ENABLE_COG |
| 171 | } |
| 172 | |
| 173 | //-------------------------------------------------------------------------------------------------------------------------- |
| 174 | void ACogSamplePlayerController::SetTarget(AActor* Value) |
nothing calls this directly
no test coverage detected