30 lines
506 B
C#
30 lines
506 B
C#
|
|
using Godot;
|
||
|
|
|
||
|
|
using Rokojori.Extensions;
|
||
|
|
namespace Rokojori;
|
||
|
|
|
||
|
|
[Tool]
|
||
|
|
[GlobalClass, Icon("res://addons/rokojori_action_library/Icons/Action.svg")]
|
||
|
|
public abstract partial class BehaviorBranch:Node
|
||
|
|
{
|
||
|
|
[Export]
|
||
|
|
public bool invert = false;
|
||
|
|
|
||
|
|
protected virtual bool _IsBranchActive( Brain brain )
|
||
|
|
{
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
public bool IsBranchActive( Brain brain )
|
||
|
|
{
|
||
|
|
var active = _IsBranchActive( brain );
|
||
|
|
|
||
|
|
if ( invert )
|
||
|
|
{
|
||
|
|
active = ! active;
|
||
|
|
}
|
||
|
|
|
||
|
|
return active;
|
||
|
|
}
|
||
|
|
}
|