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

Commit 22900ea

Browse files
committed
Merge branch 'develop'
2 parents c897e64 + ab30bda commit 22900ea

21 files changed

+339
-5
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using MoreMountains.TopDownEngine;
2+
using MoreMountains.Tools;
3+
using TheBitCave.MMToolsExtensions.AI.Graph;
4+
using UnityEngine;
5+
6+
namespace TheBitCave.TopDownEngineExensions.AI.Graph
7+
{
8+
/// <summary>
9+
/// A node representing a TopDown Engine <see cref="MoreMountains.TopDownEngine.AIActionFaceTowardsTarget2D"/> action.
10+
/// </summary>
11+
[CreateNodeMenu("AI/Action/2D/Face Towards Target")]
12+
13+
public class AIActionFaceTowardsTarget2DNode : AIActionNode
14+
{
15+
public AIActionFaceTowardsTarget2D.Modes mode = AIActionFaceTowardsTarget2D.Modes.LeftRight;
16+
17+
public override AIAction AddActionComponent(GameObject go)
18+
{
19+
var action = go.AddComponent<AIActionFaceTowardsTarget2D>();
20+
action.Label = label;
21+
action.Mode = mode;
22+
return action;
23+
}
24+
}
25+
}

Common/Scripts/AI/Graph/Actions/AIActionFaceTowardsTarget2DNode.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using MoreMountains.TopDownEngine;
2+
using MoreMountains.Tools;
3+
using TheBitCave.MMToolsExtensions.AI.Graph;
4+
using UnityEngine;
5+
6+
namespace TheBitCave.TopDownEngineExensions.AI.Graph
7+
{
8+
/// <summary>
9+
/// A node representing a TopDown Engine <see cref="MoreMountains.TopDownEngine.AIActionInvertPatrolDirection"/> action.
10+
/// </summary>
11+
[CreateNodeMenu("AI/Action/Invert Patrol Direction")]
12+
public class AIActionInvertPatrolDirectionNode : AIActionNode
13+
{
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+
}
26+
}
27+
}

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

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using MoreMountains.TopDownEngine;
2+
using MoreMountains.Tools;
3+
using TheBitCave.MMToolsExtensions.AI.Graph;
4+
using UnityEngine;
5+
6+
namespace TheBitCave.TopDownEngineExensions.AI.Graph
7+
{
8+
/// <summary>
9+
/// A node representing a TopDown Engine <see cref="MoreMountains.TopDownEngine.AIActionRotateTowardsTarget2D"/> action.
10+
/// </summary>
11+
[CreateNodeMenu("AI/Action/2D/Rotate Towards Target")]
12+
public class AIActionRotateTowardsTarget2DNode : AIActionNode
13+
{
14+
15+
public bool lockRotationX = false;
16+
17+
public override AIAction AddActionComponent(GameObject go)
18+
{
19+
var action = go.AddComponent<AIActionRotateTowardsTarget2D>();
20+
action.Label = label;
21+
action.LockRotationX = lockRotationX;
22+
return action;
23+
}
24+
25+
}
26+
}

Common/Scripts/AI/Graph/Actions/AIActionRotateTowardsTarget2DNode.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using TheBitCave.MMToolsExtensions.AI.Graph;
2+
using UnityEditor;
3+
using XNodeEditor;
4+
5+
namespace TheBitCave.TopDownEngineExensions.AI.Graph
6+
{
7+
[CustomNodeEditor(typeof(AIActionFaceTowardsTarget2DNode))]
8+
public class AIActionFaceTowardsTarget2DNodeEditor : AIActionNodeEditor
9+
{
10+
private SerializedProperty _mode;
11+
12+
protected override void SerializeAdditionalProperties()
13+
{
14+
_mode = serializedObject.FindProperty("mode");
15+
16+
serializedObject.Update();
17+
NodeEditorGUILayout.PropertyField(_mode);
18+
serializedObject.ApplyModifiedProperties();
19+
}
20+
21+
}
22+
}

Common/Scripts/AI/Graph/Actions/Editor/AIActionFaceTowardsTarget2DNodeEditor.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using TheBitCave.MMToolsExtensions.AI.Graph;
2+
using UnityEditor;
3+
using XNodeEditor;
4+
5+
namespace TheBitCave.TopDownEngineExensions.AI.Graph
6+
{
7+
[CustomNodeEditor(typeof(AIActionInvertPatrolDirectionNode))]
8+
public class AIActionInvertPatrolDirectionNodeEditor : AIActionNodeEditor
9+
{
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+
}
28+
}
29+
}

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

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)