This commit is contained in:
ntr committed 2023-09-01 22:27:50 +10:00
1 parent cffe1930a0
commit 9f5ce196cc
9 files changed
+90 -17

No files matched your search

+14
View File
@@ -200,6 +200,20 @@ public class ShipControls : MonoBehaviour {
input.ship.powerUnit4.started += OnPowerUnit4;
}
void OnDestroy() {
input.ship.strafe.started -= OnStrafe;
input.ship.strafe.performed -= OnStrafe;
input.ship.strafe.canceled -= OnStrafe;
// these we only care about the initial press
input.ship.respawn.started -= OnRespawn;
input.ship.quit.started -= OnQuit;
input.ship.powerUnit1.started -= OnPowerUnit1;
input.ship.powerUnit2.started -= OnPowerUnit2;
input.ship.powerUnit3.started -= OnPowerUnit3;
input.ship.powerUnit4.started -= OnPowerUnit4;
}
void OnStrafe(InputAction.CallbackContext ctx) {
Vector2 str = ctx.ReadValue<Vector2>();
strafe = new Vector3(str.x, str.y, 0f) * powerUnit.Strafing;