Prototype/Source/Prototype/Private/Task_VictimScan.cpp
/* Agent behavior when a victim is detected.
*
*/
Agent behavior when a victim is detected.
Agent behavior when a victim is detected .
void AUSARAgent::OnDetectHuman(UPrimitiveComponent* agentSensor, AActor* victim, UPrimitiveComponent* humanBody, int32 neighborIndex,
	bool bFromSweep, const FHitResult& SweepResult)
{
	bool eventFromSensor = !(agentSensor->GetName().Compare("VisionSensor"));
	bool senseVictim = victim->IsA(AVictimActor::StaticClass());
	if (eventFromSensor && senseVictim) {
		victimsInRange.AddUnique(Cast<AVictimActor>(victim));
	}
}
void AUSARAgent :: OnDetectHuman ( UPrimitiveComponent * agentSensor , AActor * victim , UPrimitiveComponent * humanBody , int32 neighborIndex , bool bFromSweep , const FHitResult & SweepResult ) { bool eventFromSensor = ! ( agentSensor -> GetName ( ) . Compare ( " " ) ) ; bool senseVictim = victim -> IsA ( AVictimActor :: StaticClass ( ) ) ; if ( eventFromSensor && senseVictim ) { victimsInRange . AddUnique ( Cast < AVictimActor > ( victim ) ) ; } }
Agent behavior when a victim is detected.
Agent behavior when a victim is detected .