feat: add shoot and cooldown systems

This commit is contained in:
Bragin Stepan
2026-02-21 23:53:45 +05:00
parent 2affd03993
commit af20400b84
25 changed files with 1174 additions and 233 deletions

View File

@@ -1,4 +1,5 @@
using _Project.Develop.Runtime.Entities;
using _Project.Develop.Runtime.Utilities.Conditions;
using _Project.Develop.Runtime.Utils.ReactiveManagement;
using UnityEngine;
@@ -9,6 +10,7 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Movement
private ReactiveVariable<Vector3> _direction;
private ReactiveVariable<float> _speed;
private Transform _transform;
private ICompositeCondition _canRotate;
private const float DeadZone = 0.1f;
@@ -17,10 +19,17 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Movement
_direction = entity.RotateDirection;
_speed = entity.RotationSpeed;
_transform = entity.Transform;
_canRotate = entity.CanRotate;
if (_direction.Value != Vector3.zero)
_transform.rotation = Quaternion.LookRotation(_direction.Value.normalized);
}
public void OnUpdate(float deltaTime)
{
if (_canRotate.Evaluate() == false)
return;
if (_direction.Value.magnitude < DeadZone)
return;