This commit is contained in:
Bragin Stepan
2026-02-19 23:19:33 +05:00
parent e07bde989a
commit 1174be2d43
70 changed files with 3307 additions and 591 deletions

View File

@@ -0,0 +1,17 @@
using System;
using UnityEngine;
namespace _Project.Develop.Runtime.Utils.InputManagement
{
public interface IPlayerInput : IInput
{
InputState<Vector2> Move { get; }
InputState<Vector2> Look { get; }
InputState<float> Jump { get; }
InputState<float> Sprint { get; }
InputState<float> Interact { get; }
InputState<float> Crouch { get; }
InputState<float> Previous { get; }
InputState<float> Next { get; }
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 26e35755eaef45dc9366a75a77333fae
timeCreated: 1770408646

View File

@@ -0,0 +1,15 @@
using System;
using UnityEngine;
namespace _Project.Develop.Runtime.Utils.InputManagement
{
public interface IUIInput : IInput
{
InputState<Vector2> Point { get; }
InputState<Vector2> Navigate { get; }
InputState<float> Click { get; }
InputState<float> RightClick { get; }
InputState<float> MiddleClick { get; }
InputState<Vector2> ScrollWheel { get; }
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 68276677297d4ea2b4cf908903e2f927
timeCreated: 1770408654

View File

@@ -0,0 +1,52 @@
using UnityEngine;
using PlayerActions = UserInputAction.PlayerActions;
namespace _Project.Develop.Runtime.Utils.InputManagement.Inputs
{
public class PlayerInput : InputBase, IPlayerInput
{
public InputState<Vector2> Move { get; }
public InputState<Vector2> Look { get; }
public InputState<float> Jump { get; }
public InputState<float> Sprint { get; }
public InputState<float> Interact { get; }
public InputState<float> Crouch { get; }
public InputState<float> Previous { get; }
public InputState<float> Next { get; }
private readonly PlayerActions _playerActions;
public PlayerInput(PlayerActions playerActions)
{
_playerActions = playerActions;
Move = Register<Vector2>(_playerActions.Move);
Look = Register<Vector2>(_playerActions.Look);
Jump = Register<float>(_playerActions.Jump);
Sprint = Register<float>(_playerActions.Sprint);
Interact = Register<float>(_playerActions.Interact);
Crouch = Register<float>(_playerActions.Crouch);
Previous = Register<float>(_playerActions.Previous);
Next = Register<float>(_playerActions.Next);
}
public void Initialize()
{
Disable();
}
public override void Enable()
{
base.Enable();
_playerActions.Enable();
}
public override void Disable()
{
base.Disable();
_playerActions.Disable();
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 3f24c94d005646f18e40368665121d62
timeCreated: 1770408676

View File

@@ -0,0 +1,49 @@
using UnityEngine;
using UIActions = UserInputAction.UIActions;
namespace _Project.Develop.Runtime.Utils.InputManagement.Inputs
{
public class UIInput : InputBase, IUIInput
{
public InputState<Vector2> Point { get; }
public InputState<Vector2> Navigate { get; }
public InputState<float> Click { get; }
public InputState<float> RightClick { get; }
public InputState<float> MiddleClick { get; }
public InputState<Vector2> ScrollWheel { get; }
// public InputState<Vector2> DeviceOrientation { get; }
private readonly UIActions _uiActions;
public UIInput(UIActions uiActions)
{
_uiActions = uiActions;
Point = Register<Vector2>(_uiActions.Point);
Navigate = Register<Vector2>(_uiActions.Navigate);
Click = Register<float>(_uiActions.Click);
RightClick = Register<float>(_uiActions.RightClick);
MiddleClick = Register<float>(_uiActions.MiddleClick);
ScrollWheel = Register<Vector2>(_uiActions.ScrollWheel);
// DeviceOrientation = Register<Vector2>(_uiActions.TrackedDeviceOrientation);
}
public void Initialize()
{
Disable();
}
public override void Enable()
{
base.Enable();
_uiActions.Enable();
}
public override void Disable()
{
base.Disable();
_uiActions.Disable();
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: bdb01f1b865b461f816e8d4dff0c0aeb
timeCreated: 1770414125