From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- .../SimpleCharacterControllerNodes.cs | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Runtime/Graphs/UnityEngine.Graphs/LogicNodeLibrary/CharacterController/SimpleCharacterControllerNodes.cs (limited to 'Runtime/Graphs/UnityEngine.Graphs/LogicNodeLibrary/CharacterController') diff --git a/Runtime/Graphs/UnityEngine.Graphs/LogicNodeLibrary/CharacterController/SimpleCharacterControllerNodes.cs b/Runtime/Graphs/UnityEngine.Graphs/LogicNodeLibrary/CharacterController/SimpleCharacterControllerNodes.cs new file mode 100644 index 0000000..89d791a --- /dev/null +++ b/Runtime/Graphs/UnityEngine.Graphs/LogicNodeLibrary/CharacterController/SimpleCharacterControllerNodes.cs @@ -0,0 +1,24 @@ +using UnityEngine; + +namespace UnityEngine.Graphs.LogicGraph +{ + public sealed class SimpleCharacterControllerNodes + { + [Logic(typeof(CharacterController))] + public static void SimpleMove (CharacterController self, Vector3 speed, Action grounded, Action airborne) + { + if (self.SimpleMove (speed)) + { + if (grounded != null) grounded (); + } + else if (airborne != null) airborne (); + } + + [Logic(typeof(CharacterController))] + public static CollisionFlags Move (CharacterController self, Vector3 motion) + { + return self.Move (motion); + } + } +} + -- cgit v1.1-26-g67d0