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
6409f75
commit 5b8a95b
Showing
7 changed files
with
274 additions
and
6 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
Common/Scripts/Agents/AI/Graph/Actions/AIActionSwapBrainNode.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,25 @@ | ||
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; | ||
} | ||
|
||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Common/Scripts/Agents/AI/Graph/Actions/AIActionSwapBrainNode.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
Common/Scripts/Agents/AI/Graph/Actions/Editor/AIActionSwapBrainNodeEditor.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,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(); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Common/Scripts/Agents/AI/Graph/Actions/Editor/AIActionSwapBrainNodeEditor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.