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

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosecchi committed Oct 22, 2020
2 parents ad9b00e + 0a14244 commit 58b86e0
Show file tree
Hide file tree
Showing 17 changed files with 4,282 additions and 3,513 deletions.
27 changes: 27 additions & 0 deletions Common/Scripts/Agents/AI/Graph/Actions/AIActionMMFeedbacksNode.cs
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.

24 changes: 24 additions & 0 deletions Common/Scripts/Agents/AI/Graph/Actions/AIActionSwapBrainNode.cs
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.

27 changes: 27 additions & 0 deletions Common/Scripts/Agents/AI/Graph/Actions/AIActionUnityEventsNode.cs
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
Expand Up @@ -23,6 +23,5 @@ protected override void SerializeAdditionalProperties()
NodeEditorGUILayout.PropertyField(_targetOffset);
serializedObject.ApplyModifiedProperties();
}

}
}
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.

Loading

0 comments on commit 58b86e0

Please sign in to comment.