1
0
KF2-Dev-Scripts/Engine/Classes/Path_TowardGoal.uc

44 lines
764 B
Ucode
Raw Permalink Normal View History

2020-12-13 15:01:13 +00:00
/**
* Copyright 1998-2013 Epic Games, Inc. All Rights Reserved.
*/
class Path_TowardGoal extends PathConstraint
native(AI);
cpptext
{
// Interface
virtual UBOOL EvaluatePath( UReachSpec* Spec, APawn* Pawn, INT& out_PathCost, INT& out_HeuristicCost );
}
/** Goal trying to find path toward */
var Actor GoalActor;
static function bool TowardGoal( Pawn P, Actor Goal )
{
local Path_TowardGoal Con;
if( P != None && Goal != None )
{
Con = Path_TowardGoal(P.CreatePathConstraint(default.class));
if( Con != None )
{
Con.GoalActor = Goal;
P.AddPathConstraint( Con );
return TRUE;
}
}
return FALSE;
}
function Recycle()
{
Super.Recycle();
GoalActor=none;
}
defaultproperties
{
Cacheidx=1
}