init: add project

This commit is contained in:
Bragin Stepan
2026-02-18 23:02:28 +05:00
commit 4f01e66894
620 changed files with 52253 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
using System;
using UnityEngine;
namespace _Project.Develop.Runtime.Utilities.InputManagement
{
public class DesktopPlayerInputService : IPlayerInputService
{
public event Action OnJump;
public event Action OnInteract;
public event Action OnPrevious;
public event Action OnNext;
private const string HorizontalAxisKey = "Horizontal";
private const string VerticalAxisKey = "Vertical";
private const KeyCode JumpKey = KeyCode.Space;
private const KeyCode InteractKey = KeyCode.F;
private const KeyCode PreviousKey = KeyCode.Q;
private const KeyCode NextKey = KeyCode.E;
public bool IsEnabled { get; set; } = true;
public Vector2 Move
{
get
{
if (IsEnabled == false)
return Vector2.zero;
return new Vector2(Input.GetAxisRaw(HorizontalAxisKey), Input.GetAxisRaw(VerticalAxisKey));
}
}
public void Enable() => IsEnabled = true;
public void Disable() => IsEnabled = false;
public void Update(float deltaTime)
{
if (IsEnabled == false)
return;
if (Input.GetKeyDown(JumpKey))
OnJump?.Invoke();
if (Input.GetKeyDown(InteractKey))
OnInteract?.Invoke();
if (Input.GetKeyDown(PreviousKey))
OnPrevious?.Invoke();
if (Input.GetKeyDown(NextKey))
OnNext?.Invoke();
}
public string GetKeyboardInput()
{
if (IsEnabled == false)
return null;
for (int i = 0; i <= 9; i++)
if (Input.GetKeyDown(KeyCode.Alpha0 + i))
return i.ToString();
for (int i = 0; i < 26; i++)
{
if (Input.GetKeyDown(KeyCode.A + i))
{
char letter = (char)('A' + i);
return letter.ToString();
}
}
return null;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6e89482289184f2b93a4ddf77af98da7
timeCreated: 1770397340

View File

@@ -0,0 +1,13 @@
namespace _Project.Develop.Runtime.Utilities.InputManagement
{
public interface IInput
{
bool IsEnabled { get; set; }
void Enable();
void Disable();
void Update(float deltaTime);
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1d448be7d0ba4d988578d646da708c41
timeCreated: 1770397262

View File

@@ -0,0 +1,20 @@
using System;
using UnityEngine;
namespace _Project.Develop.Runtime.Utilities.InputManagement
{
public interface IPlayerInputService : IInput
{
event Action OnJump;
event Action OnInteract;
event Action OnPrevious;
event Action OnNext;
Vector2 Move { get; }
string GetKeyboardInput();
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: de8df9e58e214573bb1d44996dc62484
timeCreated: 1770396950

View File

@@ -0,0 +1,7 @@
namespace _Project.Develop.Runtime.Utilities.InputManagement
{
public interface IUIInputService : IInput
{
// всякие клики
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: f60f1acd260a4846943950a6e6682a9b
timeCreated: 1770397255