feat: add teleport system

This commit is contained in:
Bragin Stepan
2026-02-22 16:34:56 +05:00
parent 366a388036
commit 6a2f3a39d3
12 changed files with 349 additions and 6 deletions

View File

@@ -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 TeleportByInputSystem : IInitializableSystem, IDisposableSystem
{
private readonly IPlayerInput _playerInput;
private ReactiveEvent _startTeleportRequest;
public TeleportByInputSystem(IPlayerInput playerInput)
{
_playerInput = playerInput;
}
public void OnInit(Entity entity)
{
_startTeleportRequest = entity.StartTeleportRequest;
_playerInput.Jump.Enter += OnTeleportRequest;
}
private void OnTeleportRequest(float value)
{
_startTeleportRequest.Invoke();
}
public void OnDispose()
{
_playerInput.Jump.Enter -= OnTeleportRequest;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 585250d7186e42928f1909e712a63f12
timeCreated: 1771759696