This commit is contained in:
CortexCore
2023-10-04 16:50:27 +08:00
parent 947e52e748
commit 5cd094ed9a
263 changed files with 144068 additions and 66 deletions

View File

@@ -1,3 +1,4 @@
using System;
using System.Linq;
using BITFALL.Guns.States;
using BITFALL.Player.Movement;
@@ -118,8 +119,16 @@ namespace BITFALL.Guns
_playerMovement = entity.Get<IPlayerMovement>();
_movement.OnStateChanged += OnMovementStateChanged;
_movement.OnCommand += OnMovementCommand;
}
private void OnDestroy()
{
actionGroup.UnRegisterCallback(fireAction, OnFire);
actionGroup.UnRegisterCallback(aimAction, OnAim);
actionGroup.UnRegisterCallback(reloadAction, OnReload);
actionGroup.UnRegisterCallback(meleeAction, OnMelee);
}
private void OnMovementCommand(object obj)
{
switch (obj)