Prototype/Source/Prototype/Private/Task_VictimScan.cpp
/* Agent behavior when a victim leaves the range of agent's sensors.
*
*/
Agent behavior when a victim leaves the range of agent's sensors.
Agent behavior when a victim leaves the range of agent ' s sensors .
void AUSARAgent::OnUnDetectHuman(UPrimitiveComponent* agentSensor, AActor* victim, UPrimitiveComponent* humanBody, int32 neighborIndex)
{
	bool eventFromSensor = !(agentSensor->GetName().Compare("VisionSensor"));
	bool senseVictim = victim->IsA(AVictimActor::StaticClass());
	if (eventFromSensor && senseVictim) {
		victimsInRange.Remove(Cast<AVictimActor>(victim));
	}
}
void AUSARAgent :: OnUnDetectHuman ( UPrimitiveComponent * agentSensor , AActor * victim , UPrimitiveComponent * humanBody , int32 neighborIndex ) { bool eventFromSensor = ! ( agentSensor -> GetName ( ) . Compare ( " " ) ) ; bool senseVictim = victim -> IsA ( AVictimActor :: StaticClass ( ) ) ; if ( eventFromSensor && senseVictim ) { victimsInRange . Remove ( Cast < AVictimActor > ( victim ) ) ; } }
Agent behavior when a victim leaves the range of agent's sensors.
Agent behavior when a victim leaves the range of agent ' s sensors .