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
a6c3db7
commit ace25e1
Showing
5 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
Common/Scripts/Agents/AI/Graph/Actions/AIActionSelfDestructNode.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 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.AIActionSelfDestruct"/> action. | ||
/// </summary> | ||
[CreateNodeMenu("AI/Action/Self Destruct")] | ||
public class AIActionSelfDestructNode : AIActionNode | ||
{ | ||
public bool onlyRunOnce = true; | ||
|
||
public override AIAction AddActionComponent(GameObject go) | ||
{ | ||
var action = go.AddComponent<AIActionSelfDestruct>(); | ||
action.Label = label; | ||
action.OnlyRunOnce = onlyRunOnce; | ||
return action; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Common/Scripts/Agents/AI/Graph/Actions/AIActionSelfDestructNode.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
23 changes: 23 additions & 0 deletions
23
Common/Scripts/Agents/AI/Graph/Actions/Editor/AIActionSelfDestructNodeEditor.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,23 @@ | ||
using MoreMountains.CorgiEngine; | ||
using TheBitCave.MMToolsExtensions.AI.Graph; | ||
using UnityEditor; | ||
using XNodeEditor; | ||
|
||
namespace TheBitCave.CorgiExensions.AI.Graph | ||
{ | ||
[CustomNodeEditor(typeof(AIActionSelfDestructNode))] | ||
public class AIActionSelfDestructNodeEditor : AIActionNodeEditor | ||
{ | ||
private SerializedProperty _onlyRunOnce; | ||
|
||
protected override void SerializeAdditionalProperties() | ||
{ | ||
_onlyRunOnce = serializedObject.FindProperty("onlyRunOnce"); | ||
|
||
serializedObject.Update(); | ||
EditorGUIUtility.labelWidth = 200; | ||
NodeEditorGUILayout.PropertyField(_onlyRunOnce); | ||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Common/Scripts/Agents/AI/Graph/Actions/Editor/AIActionSelfDestructNodeEditor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.