mirror of
https://github.com/Bragin-Stepan/project-entity.git
synced 2026-03-05 07:41:10 +00:00
feat: add shoot and cooldown systems
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using _Project.Develop.Runtime.Entities;
|
||||
using _Project.Develop.Runtime.Utils.InputManagement;
|
||||
using _Project.Develop.Runtime.Utils.ReactiveManagement.Event;
|
||||
using UnityEngine;
|
||||
|
||||
namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Input
|
||||
{
|
||||
public class AttackByInputSystem : IInitializableSystem, IDisposableSystem
|
||||
{
|
||||
private readonly IPlayerInput _playerInput;
|
||||
|
||||
private ReactiveEvent _startAttackRequest;
|
||||
|
||||
public AttackByInputSystem(IPlayerInput playerInput)
|
||||
{
|
||||
_playerInput = playerInput;
|
||||
}
|
||||
|
||||
public void OnInit(Entity entity)
|
||||
{
|
||||
_startAttackRequest = entity.StartAttackRequest;
|
||||
|
||||
_playerInput.Interact.Enter += OnAttackRequest;
|
||||
}
|
||||
|
||||
private void OnAttackRequest(float value)
|
||||
{
|
||||
_startAttackRequest.Invoke();
|
||||
}
|
||||
|
||||
public void OnDispose()
|
||||
{
|
||||
_playerInput.Interact.Enter -= OnAttackRequest;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b9a5877786f409aa00af044e4b0ab10
|
||||
timeCreated: 1771695880
|
||||
@@ -3,7 +3,7 @@ using _Project.Develop.Runtime.Utils.InputManagement;
|
||||
using _Project.Develop.Runtime.Utils.ReactiveManagement;
|
||||
using UnityEngine;
|
||||
|
||||
namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Movement
|
||||
namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Input
|
||||
{
|
||||
public class MoveDirectionByInputSystem : IInitializableSystem, IUpdatableSystem
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using _Project.Develop.Runtime.Utils.InputManagement;
|
||||
using _Project.Develop.Runtime.Utils.ReactiveManagement;
|
||||
using UnityEngine;
|
||||
|
||||
namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Movement
|
||||
namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Input
|
||||
{
|
||||
public class RotateDirectionByMoveInputSystem : IInitializableSystem, IUpdatableSystem
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user