Add Has Tag decorator
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#if USE_CSHARP
|
||||
#include "Engine/Scripting/ManagedCLR/MClass.h"
|
||||
#endif
|
||||
#include "Engine/Level/Actor.h"
|
||||
#include "Engine/Serialization/Serialization.h"
|
||||
|
||||
bool IsAssignableFrom(const StringAnsiView& to, const StringAnsiView& from)
|
||||
@@ -445,3 +446,13 @@ bool BehaviorTreeKnowledgeValuesConditionalDecorator::CanUpdate(const BehaviorUp
|
||||
{
|
||||
return BehaviorKnowledge::CompareValues((float)ValueA.Get(context.Knowledge), (float)ValueB.Get(context.Knowledge), Comparison);
|
||||
}
|
||||
|
||||
bool BehaviorTreeHasTagDecorator::CanUpdate(const BehaviorUpdateContext& context)
|
||||
{
|
||||
bool result = false;
|
||||
::Actor* actor;
|
||||
if (Actor.TryGet(context.Knowledge, actor) && actor)
|
||||
result = actor->HasTag(Tag);
|
||||
result ^= Invert;
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user