This repository has been archived by the owner on Apr 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b8a95b
commit 0a14244
Showing
10 changed files
with
146 additions
and
2 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
Common/Scripts/Agents/AI/Graph/Actions/AIActionMMFeedbacksNode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using MoreMountains.CorgiEngine; | ||
using MoreMountains.Feedbacks; | ||
using MoreMountains.Tools; | ||
using TheBitCave.MMToolsExtensions.AI.Graph; | ||
using UnityEngine; | ||
|
||
namespace TheBitCave.CorgiExensions.AI.Graph | ||
{ | ||
/// <summary> | ||
/// A node representing a Corgi <see cref="MoreMountains.CorgiEngine.AIActionMMFeedbacks"/> action. | ||
/// </summary> | ||
[CreateNodeMenu("AI/Action/MMFeedbacks")] | ||
public class AIActionMMFeedbacksNode : AIActionNode | ||
{ | ||
public MMFeedbacks targetFeedbacks; | ||
public bool onlyPlayWhenEnteringState = true; | ||
|
||
public override AIAction AddActionComponent(GameObject go) | ||
{ | ||
var action = go.AddComponent<AIActionMMFeedbacks>(); | ||
action.Label = label; | ||
action.OnlyPlayWhenEnteringState = onlyPlayWhenEnteringState; | ||
action.TargetFeedbacks = targetFeedbacks; | ||
return action; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Common/Scripts/Agents/AI/Graph/Actions/AIActionMMFeedbacksNode.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,5 @@ public override AIAction AddActionComponent(GameObject go) | |
action.NewAIBrain = newAIBrain; | ||
return action; | ||
} | ||
|
||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
Common/Scripts/Agents/AI/Graph/Actions/AIActionUnityEventsNode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using MoreMountains.CorgiEngine; | ||
using MoreMountains.Tools; | ||
using TheBitCave.MMToolsExtensions.AI.Graph; | ||
using UnityEngine; | ||
using UnityEngine.Events; | ||
|
||
namespace TheBitCave.CorgiExensions.AI.Graph | ||
{ | ||
/// <summary> | ||
/// A node representing a Corgi <see cref="MoreMountains.CorgiEngine.AIActionUnityEvents"/> action. | ||
/// </summary> | ||
[CreateNodeMenu("AI/Action/Unity Events")] | ||
public class AIActionUnityEventsNode : AIActionNode | ||
{ | ||
public UnityEvent targetEvent; | ||
public bool onlyPlayWhenEnteringState = true; | ||
|
||
public override AIAction AddActionComponent(GameObject go) | ||
{ | ||
var action = go.AddComponent<AIActionUnityEvents>(); | ||
action.Label = label; | ||
action.OnlyPlayWhenEnteringState = onlyPlayWhenEnteringState; | ||
action.TargetEvent = targetEvent; | ||
return action; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Common/Scripts/Agents/AI/Graph/Actions/AIActionUnityEventsNode.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
Common/Scripts/Agents/AI/Graph/Actions/Editor/AIActionMMFeedbacksNodeEditor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using TheBitCave.MMToolsExtensions.AI.Graph; | ||
using UnityEditor; | ||
using XNodeEditor; | ||
|
||
namespace TheBitCave.CorgiExensions.AI.Graph | ||
{ | ||
[CustomNodeEditor(typeof(AIActionMMFeedbacksNode))] | ||
public class AIActionMMFeedbacksNodeEditor : AIActionNodeEditor | ||
{ | ||
private SerializedProperty _targetFeedbacks; | ||
private SerializedProperty _onlyPlayWhenEnteringState; | ||
|
||
protected override void SerializeAdditionalProperties() | ||
{ | ||
_targetFeedbacks = serializedObject.FindProperty("targetFeedbacks"); | ||
_onlyPlayWhenEnteringState = serializedObject.FindProperty("onlyPlayWhenEnteringState"); | ||
|
||
serializedObject.Update(); | ||
NodeEditorGUILayout.PropertyField(_targetFeedbacks); | ||
NodeEditorGUILayout.PropertyField(_onlyPlayWhenEnteringState); | ||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Common/Scripts/Agents/AI/Graph/Actions/Editor/AIActionMMFeedbacksNodeEditor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
Common/Scripts/Agents/AI/Graph/Actions/Editor/AIActionUnityEventsNodeEditor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using TheBitCave.MMToolsExtensions.AI.Graph; | ||
using UnityEditor; | ||
using XNodeEditor; | ||
|
||
namespace TheBitCave.CorgiExensions.AI.Graph | ||
{ | ||
[CustomNodeEditor(typeof(AIActionUnityEventsNode))] | ||
public class AIActionUnityEventsNodeEditor : AIActionNodeEditor | ||
{ | ||
private SerializedProperty _targetEvent; | ||
private SerializedProperty _onlyPlayWhenEnteringState; | ||
|
||
protected override void SerializeAdditionalProperties() | ||
{ | ||
_targetEvent = serializedObject.FindProperty("targetEvent"); | ||
_onlyPlayWhenEnteringState = serializedObject.FindProperty("onlyPlayWhenEnteringState"); | ||
|
||
serializedObject.Update(); | ||
NodeEditorGUILayout.PropertyField(_targetEvent); | ||
NodeEditorGUILayout.PropertyField(_onlyPlayWhenEnteringState); | ||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Common/Scripts/Agents/AI/Graph/Actions/Editor/AIActionUnityEventsNodeEditor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.