Skip to content
This repository was archived by the owner on Apr 3, 2022. It is now read-only.

Commit b08c3cc

Browse files
committed
Add AIActionInvertPatrolDirectionNode.
1 parent fead304 commit b08c3cc

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

Common/Scripts/AI/Graph/Actions/AIActionInvertPatrolDirectionNode.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,22 @@
66
namespace TheBitCave.TopDownEngineExensions.AI.Graph
77
{
88
/// <summary>
9-
/// A node representing a TopDown Engine <see cref="MoreMountains.TopDownEngine.AIActionChangeWeapon"/> action.
9+
/// A node representing a TopDown Engine <see cref="MoreMountains.TopDownEngine.AIActionInvertPatrolDirection"/> action.
1010
/// </summary>
1111
[CreateNodeMenu("AI/Action/Invert Patrol Direction")]
1212
public class AIActionInvertPatrolDirectionNode : AIActionNode
1313
{
14+
// [Header("Invert Patrol Action Bindings")]
15+
// public AIActionMovePatrol2D movePatrol2D;
16+
// public AIActionMovePatrol3D movePatrol3D;
17+
18+
public override AIAction AddActionComponent(GameObject go)
19+
{
20+
var action = go.AddComponent<AIActionInvertPatrolDirection>();
21+
action.Label = label;
22+
// action._movePatrol2D = movePatrol2D;
23+
// action._movePatrol3D = movePatrol3D;
24+
return action;
25+
}
1426
}
1527
}

Common/Scripts/AI/Graph/Actions/Editor/AIActionInvertPatrolDirectionNodeEditor.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,23 @@ namespace TheBitCave.TopDownEngineExensions.AI.Graph
77
[CustomNodeEditor(typeof(AIActionInvertPatrolDirectionNode))]
88
public class AIActionInvertPatrolDirectionNodeEditor : AIActionNodeEditor
99
{
10+
// private SerializedProperty _movePatrol2D;
11+
// private SerializedProperty _movePatrol3D;
12+
13+
protected override void SerializeAdditionalProperties()
14+
{
15+
// _movePatrol2D = serializedObject.FindProperty("movePatrol2D");
16+
// _movePatrol3D = serializedObject.FindProperty("movePatrol3D");
17+
18+
serializedObject.Update();
19+
// NodeEditorGUILayout.PropertyField(_movePatrol2D);
20+
// NodeEditorGUILayout.PropertyField(_movePatrol3D);
21+
22+
EditorGUILayout.HelpBox(
23+
"Move Patrol 2D and 3D properties are hidden. You will have to manually add them once the generator has been executed or assign them at runtime.",
24+
MessageType.Warning);
25+
26+
serializedObject.ApplyModifiedProperties();
27+
}
1028
}
1129
}

0 commit comments

Comments
 (0)