commit e57cffc304a322b3538e1590477bb1700e398930
parent 3a7f25f4a59578f1508b4bfc2e7812517ac5a781
Author: PlutoTank <qwolkensperg@gmail.com>
Date: Thu, 16 Apr 2020 15:26:53 -0400
Added two dimentional axis trigger
Diffstat:
1 file changed, 26 insertions(+), 0 deletions(-)
diff --git a/Assets/Scripts/Slimecing/Triggers/TriggerLogic/TwoDimensionalAxisInputTrigger.cs b/Assets/Scripts/Slimecing/Triggers/TriggerLogic/TwoDimensionalAxisInputTrigger.cs
@@ -0,0 +1,26 @@
+using UnityEngine;
+using UnityEngine.InputSystem;
+
+namespace Slimecing.Triggers.TriggerLogic
+{
+ public class TwoDimensionalAxisInputTrigger : TriggerInput
+ {
+ protected override void TriggerStarted(GameObject player, InputAction.CallbackContext ctx)
+ {
+ currentTriggerState = TriggerState.Performed;
+ OnTriggerStateChange(new TriggerPackage(TriggerState.Performed, player, ctx));
+ }
+
+ protected override void TriggerPerformed(GameObject player, InputAction.CallbackContext ctx)
+ {
+ currentTriggerState = TriggerState.Performed;
+ OnTriggerStateChange(new TriggerPackage(TriggerState.Performed, player, ctx));
+ }
+
+ protected override void TriggerCanceled(GameObject player, InputAction.CallbackContext ctx)
+ {
+ currentTriggerState = TriggerState.Canceled;
+ OnTriggerStateChange(new TriggerPackage(TriggerState.Canceled, player, ctx));
+ }
+ }
+}