-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
- Loading branch information
There are no files selected for viewing
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; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using MoreMountains.CorgiEngine; | ||
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.AIActionSwapBrain"/> action. | ||
/// </summary> | ||
[CreateNodeMenu("AI/Action/Swap Brain")] | ||
public class AIActionSwapBrainNode : AIActionNode | ||
{ | ||
public AIBrain newAIBrain; | ||
|
||
public override AIAction AddActionComponent(GameObject go) | ||
{ | ||
var action = go.AddComponent<AIActionSwapBrain>(); | ||
action.Label = label; | ||
action.NewAIBrain = newAIBrain; | ||
return action; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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(); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using TheBitCave.MMToolsExtensions.AI.Graph; | ||
using UnityEditor; | ||
using XNodeEditor; | ||
|
||
namespace TheBitCave.CorgiExensions.AI.Graph | ||
{ | ||
[CustomNodeEditor(typeof(AIActionSwapBrainNode))] | ||
public class AIActionSwapBrainNodeEditor : AIActionNodeEditor | ||
{ | ||
private SerializedProperty _newAIBrain; | ||
|
||
protected override void SerializeAdditionalProperties() | ||
{ | ||
_newAIBrain = serializedObject.FindProperty("newAIBrain"); | ||
|
||
serializedObject.Update(); | ||
NodeEditorGUILayout.PropertyField(_newAIBrain); | ||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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(); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.