diff --git a/Assets/_Project/Develop/Runtime/Constants/PathToResources.cs b/Assets/_Project/Develop/Runtime/Constants/PathToResources.cs index 85298d3..e242611 100644 --- a/Assets/_Project/Develop/Runtime/Constants/PathToResources.cs +++ b/Assets/_Project/Develop/Runtime/Constants/PathToResources.cs @@ -35,7 +35,7 @@ namespace Assets._Project.Develop.Runtime.Utilities.SceneManagement public static class Entity { public const string TestEntity = "Entities/TestEntity"; - public const string Ghost = "Entities/TestEntity"; + public const string Ghost = "Entities/Ghost"; } private static readonly Dictionary _scriptableObject = new() diff --git a/Assets/_Project/Develop/Runtime/Infrastructure/EntryPoint/ProjectContextRegistrations.cs b/Assets/_Project/Develop/Runtime/Infrastructure/EntryPoint/ProjectContextRegistrations.cs index b831567..115be3b 100644 --- a/Assets/_Project/Develop/Runtime/Infrastructure/EntryPoint/ProjectContextRegistrations.cs +++ b/Assets/_Project/Develop/Runtime/Infrastructure/EntryPoint/ProjectContextRegistrations.cs @@ -3,7 +3,8 @@ using System.Collections.Generic; using _Project.Develop.Runtime.Logic.Meta.Features.Wallet; using _Project.Develop.Runtime.UI; using _Project.Develop.Runtime.UI.Core; -using _Project.Develop.Runtime.Utilities.InputManagement; +using _Project.Develop.Runtime.Utils.InputManagement; +using _Project.Develop.Runtime.Utils.InputManagement.Inputs; using _Project.Develop.Runtime.Utils.ReactiveManagement; using Assets._Project.Develop.Runtime.Infrastructure.DI; using Assets._Project.Develop.Runtime.Meta.Features.Wallet; @@ -28,7 +29,9 @@ namespace Assets._Project.Develop.Runtime.Infrastructure.EntryPoint container.RegisterAsSingle(CreateSceneLoaderService); container.RegisterAsSingle(CreateSceneSwitcherService); - container.RegisterAsSingle(CreateDesktopPlayerInputService); + container.RegisterAsSingle(CreateInputFactory); + container.RegisterAsSingle(CreatePlayerInput); + container.RegisterAsSingle(CreateUIInput); container.RegisterAsSingle(CreateSaveLoadFactory); container.RegisterAsSingle(CreateSaveLoadService); @@ -55,17 +58,17 @@ namespace Assets._Project.Develop.Runtime.Infrastructure.EntryPoint c.Resolve(), c); - private static SceneLoaderService CreateSceneLoaderService(DIContainer c) - => new(); + private static SceneLoaderService CreateSceneLoaderService(DIContainer c) => new(); - private static ResourcesAssetsLoader CreateResourcesAssetsLoader(DIContainer c) - => new(); + private static ResourcesAssetsLoader CreateResourcesAssetsLoader(DIContainer c) => new(); - private static DesktopPlayerInputService CreateDesktopPlayerInputService(DIContainer c) - => new(); + private static InputFactory CreateInputFactory(DIContainer c) => new(); - private static SaveLoadFactory CreateSaveLoadFactory(DIContainer c) - => new(); + private static PlayerInput CreatePlayerInput(DIContainer c) => c.Resolve().CreatePlayerInput(); + + private static UIInput CreateUIInput(DIContainer c) => c.Resolve().CreateUIInput(); + + private static SaveLoadFactory CreateSaveLoadFactory(DIContainer c) => new(); private static PlayerDataProvider CreatePlayerDataProvider(DIContainer c) => new(c.Resolve(), c.Resolve()); diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Entities/EntitiesFactory.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Entities/EntitiesFactory.cs index eb4e830..05ecb92 100644 --- a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Entities/EntitiesFactory.cs +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Entities/EntitiesFactory.cs @@ -1,5 +1,7 @@ -using _Project.Develop.Runtime.Logic.Gameplay.Features.Movement; -using _Project.Develop.Runtime.Utilities.InputManagement; +using _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.Systems; +using _Project.Develop.Runtime.Logic.Gameplay.Features.Movement; +using _Project.Develop.Runtime.Utilities.Conditions; +using _Project.Develop.Runtime.Utils.InputManagement; using _Project.Develop.Runtime.Utils.ReactiveManagement; using Assets._Project.Develop.Runtime.Infrastructure.DI; using Assets._Project.Develop.Runtime.Utilities.SceneManagement; @@ -11,13 +13,13 @@ namespace _Project.Develop.Runtime.Entities { private readonly EntitiesLifeContext _entitiesLifeContext; private readonly MonoEntitiesFactory _monoEntitiesFactory; - private readonly IPlayerInputService _playerInput; + private readonly IPlayerInput _playerInput; public EntitiesFactory(DIContainer container) { _entitiesLifeContext = container.Resolve(); _monoEntitiesFactory = container.Resolve(); - _playerInput = container.Resolve(); + _playerInput = container.Resolve(); } public Entity CreateGhostEntity(Vector3 position) @@ -25,18 +27,47 @@ namespace _Project.Develop.Runtime.Entities Entity entity = CreateEmpty(); _monoEntitiesFactory.Create(entity, position, PathToResources.Entity.Ghost); - + entity .AddMoveDirection() .AddRotateDirection() .AddMoveSpeed(new ReactiveVariable(10)) - .AddRotationSpeed(new ReactiveVariable(800)); - + .AddRotationSpeed(new ReactiveVariable(800)) + .AddMaxHealth(new ReactiveVariable(150)) + .AddCurrentHealth(new ReactiveVariable(150)) + .AddIsDead() + .AddIsMoving() + .AddInDeathProcess() + .AddDeathProcessInitialTime(new ReactiveVariable(2)) + .AddDeathProcessCurrentTime(); + + ICompositeCondition canMove = new CompositeCondition() + .Add(new FuncCondition(() => entity.IsDead.Value == false)); + + ICompositeCondition canRotate = new CompositeCondition() + .Add(new FuncCondition(() => entity.IsDead.Value == false)); + + ICompositeCondition mustDie = new CompositeCondition() + .Add(new FuncCondition(() => entity.CurrentHealth.Value <= 0)); + + ICompositeCondition mustSelfRelease = new CompositeCondition() + .Add(new FuncCondition(() => entity.IsDead.Value)) + .Add(new FuncCondition(() => entity.InDeathProcess.Value == false)); + + entity + .AddCanMove(canMove) + .AddCanRotate(canRotate) + .AddMustDie(mustDie) + .AddMustSelfRelease(mustSelfRelease); + entity .AddSystem(new RigidbodyMovementSystem()) .AddSystem(new RigidbodyRotationSystem()) .AddSystem(new MoveDirectionByInputSystem(_playerInput)) - .AddSystem(new RotateDirectionByInputSystem(_playerInput)); + .AddSystem(new RotateDirectionByInputSystem(_playerInput)) + .AddSystem(new DeathSwitcherSystem()) + .AddSystem(new DeathProcessTimerSystem()) + .AddSystem(new SelfReleaseSystem(_entitiesLifeContext)); _entitiesLifeContext.Add(entity); diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Entities/Generated/EntityAPI.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Entities/Generated/EntityAPI.cs index e2900fe..0299f9c 100644 --- a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Entities/Generated/EntityAPI.cs +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Entities/Generated/EntityAPI.cs @@ -78,6 +78,188 @@ namespace _Project.Develop.Runtime.Entities return AddComponent(new Assets._Project.Develop.Runtime.Gameplay.Common.NavMeshAgentComponent() {Value = value}); } + public _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.CurrentHealth CurrentHealthC => GetComponent<_Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.CurrentHealth>(); + + public _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable CurrentHealth => CurrentHealthC.Value; + + public bool TryGetCurrentHealth(out _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable value) + { + bool result = TryGetComponent(out _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.CurrentHealth component); + if(result) + value = component.Value; + else + value = default(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable); + return result; + } + + public _Project.Develop.Runtime.Entities.Entity AddCurrentHealth() + { + return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.CurrentHealth() { Value = new _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable() }); + } + + public _Project.Develop.Runtime.Entities.Entity AddCurrentHealth(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable value) + { + return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.CurrentHealth() {Value = value}); + } + + public _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.MaxHealth MaxHealthC => GetComponent<_Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.MaxHealth>(); + + public _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable MaxHealth => MaxHealthC.Value; + + public bool TryGetMaxHealth(out _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable value) + { + bool result = TryGetComponent(out _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.MaxHealth component); + if(result) + value = component.Value; + else + value = default(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable); + return result; + } + + public _Project.Develop.Runtime.Entities.Entity AddMaxHealth() + { + return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.MaxHealth() { Value = new _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable() }); + } + + public _Project.Develop.Runtime.Entities.Entity AddMaxHealth(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable value) + { + return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.MaxHealth() {Value = value}); + } + + public _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.IsDead IsDeadC => GetComponent<_Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.IsDead>(); + + public _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable IsDead => IsDeadC.Value; + + public bool TryGetIsDead(out _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable value) + { + bool result = TryGetComponent(out _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.IsDead component); + if(result) + value = component.Value; + else + value = default(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable); + return result; + } + + public _Project.Develop.Runtime.Entities.Entity AddIsDead() + { + return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.IsDead() { Value = new _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable() }); + } + + public _Project.Develop.Runtime.Entities.Entity AddIsDead(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable value) + { + return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.IsDead() {Value = value}); + } + + public _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.MustDie MustDieC => GetComponent<_Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.MustDie>(); + + public _Project.Develop.Runtime.Utilities.Conditions.ICompositeCondition MustDie => MustDieC.Value; + + public bool TryGetMustDie(out _Project.Develop.Runtime.Utilities.Conditions.ICompositeCondition value) + { + bool result = TryGetComponent(out _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.MustDie component); + if(result) + value = component.Value; + else + value = default(_Project.Develop.Runtime.Utilities.Conditions.ICompositeCondition); + return result; + } + + public _Project.Develop.Runtime.Entities.Entity AddMustDie(_Project.Develop.Runtime.Utilities.Conditions.ICompositeCondition value) + { + return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.MustDie() {Value = value}); + } + + public _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.MustSelfRelease MustSelfReleaseC => GetComponent<_Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.MustSelfRelease>(); + + public _Project.Develop.Runtime.Utilities.Conditions.ICompositeCondition MustSelfRelease => MustSelfReleaseC.Value; + + public bool TryGetMustSelfRelease(out _Project.Develop.Runtime.Utilities.Conditions.ICompositeCondition value) + { + bool result = TryGetComponent(out _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.MustSelfRelease component); + if(result) + value = component.Value; + else + value = default(_Project.Develop.Runtime.Utilities.Conditions.ICompositeCondition); + return result; + } + + public _Project.Develop.Runtime.Entities.Entity AddMustSelfRelease(_Project.Develop.Runtime.Utilities.Conditions.ICompositeCondition value) + { + return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.MustSelfRelease() {Value = value}); + } + + public _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.DeathProcessInitialTime DeathProcessInitialTimeC => GetComponent<_Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.DeathProcessInitialTime>(); + + public _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable DeathProcessInitialTime => DeathProcessInitialTimeC.Value; + + public bool TryGetDeathProcessInitialTime(out _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable value) + { + bool result = TryGetComponent(out _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.DeathProcessInitialTime component); + if(result) + value = component.Value; + else + value = default(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable); + return result; + } + + public _Project.Develop.Runtime.Entities.Entity AddDeathProcessInitialTime() + { + return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.DeathProcessInitialTime() { Value = new _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable() }); + } + + public _Project.Develop.Runtime.Entities.Entity AddDeathProcessInitialTime(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable value) + { + return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.DeathProcessInitialTime() {Value = value}); + } + + public _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.DeathProcessCurrentTime DeathProcessCurrentTimeC => GetComponent<_Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.DeathProcessCurrentTime>(); + + public _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable DeathProcessCurrentTime => DeathProcessCurrentTimeC.Value; + + public bool TryGetDeathProcessCurrentTime(out _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable value) + { + bool result = TryGetComponent(out _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.DeathProcessCurrentTime component); + if(result) + value = component.Value; + else + value = default(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable); + return result; + } + + public _Project.Develop.Runtime.Entities.Entity AddDeathProcessCurrentTime() + { + return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.DeathProcessCurrentTime() { Value = new _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable() }); + } + + public _Project.Develop.Runtime.Entities.Entity AddDeathProcessCurrentTime(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable value) + { + return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.DeathProcessCurrentTime() {Value = value}); + } + + public _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.InDeathProcess InDeathProcessC => GetComponent<_Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.InDeathProcess>(); + + public _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable InDeathProcess => InDeathProcessC.Value; + + public bool TryGetInDeathProcess(out _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable value) + { + bool result = TryGetComponent(out _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.InDeathProcess component); + if(result) + value = component.Value; + else + value = default(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable); + return result; + } + + public _Project.Develop.Runtime.Entities.Entity AddInDeathProcess() + { + return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.InDeathProcess() { Value = new _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable() }); + } + + public _Project.Develop.Runtime.Entities.Entity AddInDeathProcess(_Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable value) + { + return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.InDeathProcess() {Value = value}); + } + public _Project.Develop.Runtime.Logic.Gameplay.Features.Movement.MoveDirection MoveDirectionC => GetComponent<_Project.Develop.Runtime.Logic.Gameplay.Features.Movement.MoveDirection>(); public _Project.Develop.Runtime.Utils.ReactiveManagement.ReactiveVariable MoveDirection => MoveDirectionC.Value; @@ -260,5 +442,24 @@ namespace _Project.Develop.Runtime.Entities return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Movement.JumpForce() {Value = value}); } + public _Project.Develop.Runtime.Logic.Gameplay.Features.Movement.CanJump CanJumpC => GetComponent<_Project.Develop.Runtime.Logic.Gameplay.Features.Movement.CanJump>(); + + public _Project.Develop.Runtime.Utilities.Conditions.ICompositeCondition CanJump => CanJumpC.Value; + + public bool TryGetCanJump(out _Project.Develop.Runtime.Utilities.Conditions.ICompositeCondition value) + { + bool result = TryGetComponent(out _Project.Develop.Runtime.Logic.Gameplay.Features.Movement.CanJump component); + if(result) + value = component.Value; + else + value = default(_Project.Develop.Runtime.Utilities.Conditions.ICompositeCondition); + return result; + } + + public _Project.Develop.Runtime.Entities.Entity AddCanJump(_Project.Develop.Runtime.Utilities.Conditions.ICompositeCondition value) + { + return AddComponent(new _Project.Develop.Runtime.Logic.Gameplay.Features.Movement.CanJump() {Value = value}); + } + } } diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Input/MoveDirectionByInputSystem.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Input/MoveDirectionByInputSystem.cs index ccf9251..03ed561 100644 --- a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Input/MoveDirectionByInputSystem.cs +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Input/MoveDirectionByInputSystem.cs @@ -1,5 +1,5 @@ using _Project.Develop.Runtime.Entities; -using _Project.Develop.Runtime.Utilities.InputManagement; +using _Project.Develop.Runtime.Utils.InputManagement; using _Project.Develop.Runtime.Utils.ReactiveManagement; using UnityEngine; @@ -7,11 +7,11 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Movement { public class MoveDirectionByInputSystem : IInitializableSystem, IUpdatableSystem { - private readonly IPlayerInputService _playerInput; + private readonly IPlayerInput _playerInput; private ReactiveVariable _moveDirection; - public MoveDirectionByInputSystem(IPlayerInputService playerInput) + public MoveDirectionByInputSystem(IPlayerInput playerInput) { _playerInput = playerInput; } @@ -23,7 +23,7 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Movement public void OnUpdate(float deltaTime) { - _moveDirection.Value = new Vector3(_playerInput.Move.x, 0, _playerInput.Move.y); + _moveDirection.Value = new Vector3(_playerInput.Move.Value.x, 0, _playerInput.Move.Value.y); } } } \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Input/RotateDirectionByInputSystem.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Input/RotateDirectionByInputSystem.cs index 1332e65..b8cc4c8 100644 --- a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Input/RotateDirectionByInputSystem.cs +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Input/RotateDirectionByInputSystem.cs @@ -1,5 +1,5 @@ using _Project.Develop.Runtime.Entities; -using _Project.Develop.Runtime.Utilities.InputManagement; +using _Project.Develop.Runtime.Utils.InputManagement; using _Project.Develop.Runtime.Utils.ReactiveManagement; using UnityEngine; @@ -7,11 +7,11 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Movement { public class RotateDirectionByInputSystem : IInitializableSystem, IUpdatableSystem { - private readonly IPlayerInputService _playerInput; + private readonly IPlayerInput _playerInput; private ReactiveVariable _rotateDirection; - public RotateDirectionByInputSystem(IPlayerInputService playerInput) + public RotateDirectionByInputSystem(IPlayerInput playerInput) { _playerInput = playerInput; } @@ -23,7 +23,7 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Movement public void OnUpdate(float deltaTime) { - _rotateDirection.Value = new Vector3(_playerInput.Move.x, 0, _playerInput.Move.y); + _rotateDirection.Value = new Vector3(_playerInput.Move.Value.x, 0, _playerInput.Move.Value.y); } } } \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime.meta b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime.meta new file mode 100644 index 0000000..52e1d63 --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: ddecf634646849baa49d1c66e91377eb +timeCreated: 1771516009 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/LifetimeComponents.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/LifetimeComponents.cs new file mode 100644 index 0000000..efd02fd --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/LifetimeComponents.cs @@ -0,0 +1,17 @@ +using _Project.Develop.Runtime.Entities; +using _Project.Develop.Runtime.Utilities.Conditions; +using _Project.Develop.Runtime.Utils.ReactiveManagement; + +namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime +{ + public class CurrentHealth : IEntityComponent { public ReactiveVariable Value; } + public class MaxHealth : IEntityComponent { public ReactiveVariable Value; } + + public class IsDead : IEntityComponent { public ReactiveVariable Value; } + public class MustDie : IEntityComponent { public ICompositeCondition Value; } + public class MustSelfRelease : IEntityComponent { public ICompositeCondition Value; } + + public class DeathProcessInitialTime : IEntityComponent { public ReactiveVariable Value; } + public class DeathProcessCurrentTime : IEntityComponent { public ReactiveVariable Value; } + public class InDeathProcess : IEntityComponent { public ReactiveVariable Value; } +} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/LifetimeComponents.cs.meta b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/LifetimeComponents.cs.meta new file mode 100644 index 0000000..133614d --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/LifetimeComponents.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 82344af3543e4efabe4c37c4b0131ba0 +timeCreated: 1771516021 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems.meta b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems.meta new file mode 100644 index 0000000..61eb986 --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2bf2c15d48004f91a40b388b0c0f747a +timeCreated: 1771516038 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/DeathProcessTimerSystem.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/DeathProcessTimerSystem.cs new file mode 100644 index 0000000..a4807df --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/DeathProcessTimerSystem.cs @@ -0,0 +1,55 @@ +using System; +using _Project.Develop.Runtime.Entities; +using _Project.Develop.Runtime.Utils.ReactiveManagement; + +namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.Systems +{ + public class DeathProcessTimerSystem : IInitializableSystem, IDisposableSystem, IUpdatableSystem + { + private ReactiveVariable _isDead; + private ReactiveVariable _inDeathProcess; + + private ReactiveVariable _initialTime; + private ReactiveVariable _currentTime; + + private IDisposable _isDeadChangedDisposable; + + public void OnInit(Entity entity) + { + _isDead = entity.IsDead; + _inDeathProcess = entity.InDeathProcess; + + _initialTime = entity.DeathProcessInitialTime; + _currentTime = entity.DeathProcessCurrentTime; + + _isDeadChangedDisposable = _isDead.Subscribe(OnIsDeadChanged); + } + + public void OnUpdate(float deltaTime) + { + if (_inDeathProcess.Value == false) + return; + + _currentTime.Value -= deltaTime; + + if (CooldownIsOver()) + _inDeathProcess.Value = false; + } + + public void OnDispose() + { + _isDeadChangedDisposable.Dispose(); + } + + private void OnIsDeadChanged(bool arg1, bool isDead) + { + if (isDead) + { + _currentTime.Value = _initialTime.Value; + _inDeathProcess.Value = true; + } + } + + private bool CooldownIsOver() => _currentTime.Value <= 0; + } +} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/DeathProcessTimerSystem.cs.meta b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/DeathProcessTimerSystem.cs.meta new file mode 100644 index 0000000..b36b949 --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/DeathProcessTimerSystem.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 53e84735577342fda0ab4dc6a380d829 +timeCreated: 1771517031 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/DeathSwitcherSystem.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/DeathSwitcherSystem.cs new file mode 100644 index 0000000..91b585c --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/DeathSwitcherSystem.cs @@ -0,0 +1,27 @@ +using _Project.Develop.Runtime.Entities; +using _Project.Develop.Runtime.Utilities.Conditions; +using _Project.Develop.Runtime.Utils.ReactiveManagement; + +namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.Systems +{ + public class DeathSwitcherSystem : IInitializableSystem, IUpdatableSystem + { + private ReactiveVariable _isDead; + private ICompositeCondition _mustDie; + + public void OnInit(Entity entity) + { + _isDead = entity.IsDead; + _mustDie = entity.MustDie; + } + + public void OnUpdate(float deltaTime) + { + if (_isDead.Value) + return; + + if(_mustDie.Evaluate()) + _isDead.Value = true; + } + } +} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/DeathSwitcherSystem.cs.meta b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/DeathSwitcherSystem.cs.meta new file mode 100644 index 0000000..12fc69a --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/DeathSwitcherSystem.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2bf6fb2218944c58b52d37f7039b95ae +timeCreated: 1771516295 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/SelfReleaseSystem.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/SelfReleaseSystem.cs new file mode 100644 index 0000000..9c87d13 --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/SelfReleaseSystem.cs @@ -0,0 +1,31 @@ +using _Project.Develop.Runtime.Entities; +using _Project.Develop.Runtime.Utilities.Conditions; + +namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Lifetime.Systems +{ + public class SelfReleaseSystem : IInitializableSystem, IUpdatableSystem + { + private readonly EntitiesLifeContext _entitiesLifeContext; + + private Entity _entity; + + private ICompositeCondition _mustSelfRelease; + + public SelfReleaseSystem(EntitiesLifeContext entitiesLifeContext) + { + _entitiesLifeContext = entitiesLifeContext; + } + + public void OnInit(Entity entity) + { + _entity = entity; + _mustSelfRelease = entity.MustSelfRelease; + } + + public void OnUpdate(float deltaTime) + { + if (_mustSelfRelease.Evaluate()) + _entitiesLifeContext.Release(_entity); + } + } +} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/SelfReleaseSystem.cs.meta b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/SelfReleaseSystem.cs.meta new file mode 100644 index 0000000..d4af604 --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Lifetime/Systems/SelfReleaseSystem.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bbee24a3ed9e4e558158992dc929a348 +timeCreated: 1771516662 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/MovementComponents.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/MovementComponents.cs index a2ac811..fe42d5e 100644 --- a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/MovementComponents.cs +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/MovementComponents.cs @@ -15,5 +15,6 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Movement public class CanRotate : IEntityComponent { public ICompositeCondition Value; } public class JumpForce : IEntityComponent { public ReactiveVariable Value; } + public class CanJump : IEntityComponent { public ICompositeCondition Value; } } \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/Systems/CharacterControllerMovementSystem.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/Systems/CharacterControllerMovementSystem.cs index 84fae17..4fd840a 100644 --- a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/Systems/CharacterControllerMovementSystem.cs +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/Systems/CharacterControllerMovementSystem.cs @@ -1,4 +1,5 @@ using _Project.Develop.Runtime.Entities; +using _Project.Develop.Runtime.Utilities.Conditions; using _Project.Develop.Runtime.Utils.ReactiveManagement; using UnityEngine; @@ -9,18 +10,30 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Movement private ReactiveVariable _moveDirection; private ReactiveVariable _moveSpeed; private CharacterController _controller; + + private ReactiveVariable _isMoving; + + private ICompositeCondition _canMove; public void OnInit(Entity entity) { _moveDirection = entity.MoveDirection; _moveSpeed = entity.MoveSpeed; _controller = entity.CharacterController; + + _isMoving = entity.IsMoving; + _canMove = entity.CanMove; } public void OnUpdate(float deltaTime) { + if (_canMove.Evaluate() == false) + return; + Vector3 velocity = _moveDirection.Value.normalized * _moveSpeed.Value; + _isMoving.Value = velocity.magnitude > 0; + _controller.Move(velocity * deltaTime); } } diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/Systems/RigidbodyJumpSystem.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/Systems/RigidbodyJumpSystem.cs index ed49b30..76d8e79 100644 --- a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/Systems/RigidbodyJumpSystem.cs +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/Systems/RigidbodyJumpSystem.cs @@ -1,4 +1,5 @@ using _Project.Develop.Runtime.Entities; +using _Project.Develop.Runtime.Utilities.Conditions; using _Project.Develop.Runtime.Utils.ReactiveManagement; using UnityEngine; @@ -8,15 +9,21 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Movement { private ReactiveVariable _jumpForce; private Rigidbody _rigidbody; + + private ICompositeCondition _canJump; public void OnInit(Entity entity) { _jumpForce = entity.JumpForce; _rigidbody = entity.Rigidbody; + _canJump = entity.CanJump; } public void OnUpdate(float deltaTime) { + if (_canJump.Evaluate() == false) + return; + _rigidbody.AddForce(Vector3.up * _jumpForce.Value, ForceMode.Impulse); } } diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/Systems/RigidbodyMovementSystem.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/Systems/RigidbodyMovementSystem.cs index e9b99af..cd744d4 100644 --- a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/Systems/RigidbodyMovementSystem.cs +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/Systems/RigidbodyMovementSystem.cs @@ -1,4 +1,5 @@ using _Project.Develop.Runtime.Entities; +using _Project.Develop.Runtime.Utilities.Conditions; using _Project.Develop.Runtime.Utils.ReactiveManagement; using UnityEngine; @@ -9,17 +10,32 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Movement private ReactiveVariable _moveDirection; private ReactiveVariable _moveSpeed; private Rigidbody _rigidbody; + + private ReactiveVariable _isMoving; + private ICompositeCondition _canMove; + public void OnInit(Entity entity) { _moveDirection = entity.MoveDirection; _moveSpeed = entity.MoveSpeed; _rigidbody = entity.Rigidbody; + + _isMoving = entity.IsMoving; + _canMove = entity.CanMove; } public void OnUpdate(float deltaTime) { + if (_canMove.Evaluate() == false) + { + _rigidbody.velocity = Vector3.zero; + return; + } + Vector3 velocity = _moveDirection.Value.normalized * _moveSpeed.Value; + + _isMoving.Value = velocity.magnitude > 0; _rigidbody.velocity = velocity; } diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/Systems/RigidbodyRotationSystem.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/Systems/RigidbodyRotationSystem.cs index da0e252..283ffcb 100644 --- a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/Systems/RigidbodyRotationSystem.cs +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Features/Movement/Systems/RigidbodyRotationSystem.cs @@ -1,4 +1,5 @@ using _Project.Develop.Runtime.Entities; +using _Project.Develop.Runtime.Utilities.Conditions; using _Project.Develop.Runtime.Utils.ReactiveManagement; using UnityEngine; @@ -10,16 +11,26 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features.Movement private ReactiveVariable _speed; private ReactiveVariable _direction; + + private ICompositeCondition _canRotate; public void OnInit(Entity entity) { _rigidbody = entity.Rigidbody; _speed = entity.RotationSpeed; _direction = entity.RotateDirection; + + _canRotate = entity.CanRotate; + + if (_direction.Value != Vector3.zero) + _rigidbody.transform.rotation = Quaternion.LookRotation(_direction.Value.normalized); } public void OnUpdate(float deltaTime) { + if (_canRotate.Evaluate() == false) + return; + if (_direction.Value == Vector3.zero) return; diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Infrastructure/GameplayBootstrap.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Infrastructure/GameplayBootstrap.cs index 0bdce51..8247b1f 100644 --- a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Infrastructure/GameplayBootstrap.cs +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Infrastructure/GameplayBootstrap.cs @@ -5,7 +5,7 @@ using System; using System.Collections; using _Project.Develop.Runtime.Entities; using _Project.Develop.Runtime.Logic.Gameplay.Features; -using _Project.Develop.Runtime.Utilities.InputManagement; +using _Project.Develop.Runtime.Utils.InputManagement; using UnityEngine; namespace Assets._Project.Develop.Runtime.Gameplay.Infrastructure @@ -18,7 +18,7 @@ namespace Assets._Project.Develop.Runtime.Gameplay.Infrastructure private EntitiesLifeContext _entitiesLifeContext; private GameplayInputArgs _gameplayArgs; - private IPlayerInputService _playerInput; + private IPlayerInput _playerInput; public override void ProcessRegistrations(DIContainer container, IInputSceneArgs sceneArgs = null) { diff --git a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Infrastructure/TestGameplay.cs b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Infrastructure/TestGameplay.cs index b070cec..600af52 100644 --- a/Assets/_Project/Develop/Runtime/Logic/Gameplay/Infrastructure/TestGameplay.cs +++ b/Assets/_Project/Develop/Runtime/Logic/Gameplay/Infrastructure/TestGameplay.cs @@ -1,5 +1,5 @@ using _Project.Develop.Runtime.Entities; -using _Project.Develop.Runtime.Utilities.InputManagement; +using _Project.Develop.Runtime.Utils.InputManagement; using Assets._Project.Develop.Runtime.Infrastructure.DI; using UnityEngine; @@ -18,6 +18,7 @@ namespace _Project.Develop.Runtime.Logic.Gameplay.Features { _container = container; + _container.Resolve().Enable(); _entitiesFactory = _container.Resolve(); } diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement.meta b/Assets/_Project/Develop/Runtime/Utilities/InputManagement.meta index ed83b33..4407a66 100644 --- a/Assets/_Project/Develop/Runtime/Utilities/InputManagement.meta +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement.meta @@ -1,3 +1,3 @@ fileFormatVersion: 2 -guid: f03531ec1be8466f8e4dc6bff6bacff6 -timeCreated: 1770396920 \ No newline at end of file +guid: 525e15ae6349432194c910fa34806bb0 +timeCreated: 1771524166 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core.meta b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core.meta new file mode 100644 index 0000000..ba0f9ff --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 34ffa6b3aff14a1eaeb9f4876beb1b12 +timeCreated: 1770416206 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/IInput.cs b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/IInput.cs new file mode 100644 index 0000000..0b2138c --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/IInput.cs @@ -0,0 +1,13 @@ +using System; + +namespace _Project.Develop.Runtime.Utils.InputManagement +{ + public interface IInput : IDisposable + { + bool IsEnabled { get; } + + void Enable(); + + void Disable(); + } +} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/IInput.cs.meta b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/IInput.cs.meta new file mode 100644 index 0000000..57e6f78 --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/IInput.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 8e6f13ff5fdd4bfcae00ac967fe1803a +timeCreated: 1770406587 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/InputBase.cs b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/InputBase.cs new file mode 100644 index 0000000..3f93e68 --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/InputBase.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using UnityEngine.InputSystem; + +namespace _Project.Develop.Runtime.Utils.InputManagement.Inputs +{ + public abstract class InputBase : IDisposable + { + public bool IsEnabled { get; private set; } + + private readonly List _disposables = new(); + + protected InputState Register(InputAction action) where T : struct + { + InputState state = new(action); + + if (state is IDisposable disposable) + _disposables.Add(disposable); + + return state; + } + + public virtual void Enable() => IsEnabled = true; + + public virtual void Disable() => IsEnabled = false; + + public virtual void Dispose() + { + Disable(); + + foreach (IDisposable disposable in _disposables) + disposable.Dispose(); + + _disposables.Clear(); + } + } +} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/InputBase.cs.meta b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/InputBase.cs.meta new file mode 100644 index 0000000..65f7051 --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/InputBase.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2ea9e4fc30604b498571755608da3e91 +timeCreated: 1770464464 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/InputState.cs b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/InputState.cs new file mode 100644 index 0000000..e448214 --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/InputState.cs @@ -0,0 +1,68 @@ +using System; +using UnityEngine.InputSystem; + +namespace _Project.Develop.Runtime.Utils.InputManagement +{ + public class InputState : IDisposable where T : struct + { + public event Action Enter; + public event Action Perform; + public event Action Exit; + + public bool IsActive { get; private set; } + public T Value { get; private set; } + + private readonly InputAction _inputAction; + + public InputState(InputAction inputAction) + { + _inputAction = inputAction; + Subscribe(); + } + + private void Subscribe() + { + _inputAction.started += OnStarted; + _inputAction.performed += OnPerformed; + _inputAction.canceled += OnCanceled; + } + + private void Unsubscribe() + { + _inputAction.started -= OnStarted; + _inputAction.performed -= OnPerformed; + _inputAction.canceled -= OnCanceled; + } + + private void OnStarted(InputAction.CallbackContext ctx) + { + T value = ctx.ReadValue(); + Value = value; + IsActive = true; + Enter?.Invoke(value); + } + + private void OnPerformed(InputAction.CallbackContext ctx) + { + T value = ctx.ReadValue(); + Value = value; + Perform?.Invoke(value); + } + + private void OnCanceled(InputAction.CallbackContext ctx) + { + T value = ctx.ReadValue(); + Value = value; + IsActive = false; + Exit?.Invoke(value); + } + + public void Dispose() + { + Unsubscribe(); + Enter = null; + Perform = null; + Exit = null; + } + } +} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/InputState.cs.meta b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/InputState.cs.meta new file mode 100644 index 0000000..8a8ce09 --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Core/InputState.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e8cfbe040c144edc86e9ada246bf8b52 +timeCreated: 1770416153 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/DesktopPlayerInputService.cs b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/DesktopPlayerInputService.cs deleted file mode 100644 index 7e837a2..0000000 --- a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/DesktopPlayerInputService.cs +++ /dev/null @@ -1,77 +0,0 @@ -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; - } - } -} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/DesktopPlayerInputService.cs.meta b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/DesktopPlayerInputService.cs.meta deleted file mode 100644 index eb67621..0000000 --- a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/DesktopPlayerInputService.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 6e89482289184f2b93a4ddf77af98da7 -timeCreated: 1770397340 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IInput.cs b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IInput.cs deleted file mode 100644 index 9cb98bb..0000000 --- a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IInput.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace _Project.Develop.Runtime.Utilities.InputManagement -{ - public interface IInput - { - bool IsEnabled { get; set; } - - void Enable(); - - void Disable(); - - void Update(float deltaTime); - } -} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IInput.cs.meta b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IInput.cs.meta deleted file mode 100644 index c0aca68..0000000 --- a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IInput.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 1d448be7d0ba4d988578d646da708c41 -timeCreated: 1770397262 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IPlayerInputService.cs b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IPlayerInputService.cs deleted file mode 100644 index 1d3e9f2..0000000 --- a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IPlayerInputService.cs +++ /dev/null @@ -1,20 +0,0 @@ -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(); - } -} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IPlayerInputService.cs.meta b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IPlayerInputService.cs.meta deleted file mode 100644 index 12c8442..0000000 --- a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IPlayerInputService.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: de8df9e58e214573bb1d44996dc62484 -timeCreated: 1770396950 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IUIInputService.cs b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IUIInputService.cs deleted file mode 100644 index 4be3aa8..0000000 --- a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IUIInputService.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace _Project.Develop.Runtime.Utilities.InputManagement -{ - public interface IUIInputService : IInput - { - // всякие клики - } -} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IUIInputService.cs.meta b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IUIInputService.cs.meta deleted file mode 100644 index 6fe16e8..0000000 --- a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/IUIInputService.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: f60f1acd260a4846943950a6e6682a9b -timeCreated: 1770397255 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/InputFactory.cs b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/InputFactory.cs new file mode 100644 index 0000000..1c42556 --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/InputFactory.cs @@ -0,0 +1,13 @@ +using _Project.Develop.Runtime.Utils.InputManagement.Inputs; + +namespace _Project.Develop.Runtime.Utils.InputManagement +{ + public class InputFactory + { + private UserInputAction _userInput = new(); + + public PlayerInput CreatePlayerInput() => new(_userInput.Player); + + public UIInput CreateUIInput() => new(_userInput.UI); + } +} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/InputFactory.cs.meta b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/InputFactory.cs.meta new file mode 100644 index 0000000..5f5999d --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/InputFactory.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 31af757382f6411f879de037849b5195 +timeCreated: 1770410738 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs.meta b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs.meta new file mode 100644 index 0000000..d1a5a97 --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 13a43e150c044c9aa77c0ac983add8d2 +timeCreated: 1770408893 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/IPlayerInput.cs b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/IPlayerInput.cs new file mode 100644 index 0000000..3fa4d19 --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/IPlayerInput.cs @@ -0,0 +1,17 @@ +using System; +using UnityEngine; + +namespace _Project.Develop.Runtime.Utils.InputManagement +{ + public interface IPlayerInput : IInput + { + InputState Move { get; } + InputState Look { get; } + InputState Jump { get; } + InputState Sprint { get; } + InputState Interact { get; } + InputState Crouch { get; } + InputState Previous { get; } + InputState Next { get; } + } +} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/IPlayerInput.cs.meta b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/IPlayerInput.cs.meta new file mode 100644 index 0000000..e67e492 --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/IPlayerInput.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 26e35755eaef45dc9366a75a77333fae +timeCreated: 1770408646 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/IUIInput.cs b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/IUIInput.cs new file mode 100644 index 0000000..ca2b12f --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/IUIInput.cs @@ -0,0 +1,15 @@ +using System; +using UnityEngine; + +namespace _Project.Develop.Runtime.Utils.InputManagement +{ + public interface IUIInput : IInput + { + InputState Point { get; } + InputState Navigate { get; } + InputState Click { get; } + InputState RightClick { get; } + InputState MiddleClick { get; } + InputState ScrollWheel { get; } + } +} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/IUIInput.cs.meta b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/IUIInput.cs.meta new file mode 100644 index 0000000..b032b56 --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/IUIInput.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 68276677297d4ea2b4cf908903e2f927 +timeCreated: 1770408654 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/PlayerInput.cs b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/PlayerInput.cs new file mode 100644 index 0000000..b5e623f --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/PlayerInput.cs @@ -0,0 +1,52 @@ +using UnityEngine; +using PlayerActions = UserInputAction.PlayerActions; + +namespace _Project.Develop.Runtime.Utils.InputManagement.Inputs +{ + public class PlayerInput : InputBase, IPlayerInput + { + public InputState Move { get; } + public InputState Look { get; } + public InputState Jump { get; } + public InputState Sprint { get; } + public InputState Interact { get; } + public InputState Crouch { get; } + public InputState Previous { get; } + public InputState Next { get; } + + private readonly PlayerActions _playerActions; + + public PlayerInput(PlayerActions playerActions) + { + _playerActions = playerActions; + + Move = Register(_playerActions.Move); + Look = Register(_playerActions.Look); + Jump = Register(_playerActions.Jump); + Sprint = Register(_playerActions.Sprint); + Interact = Register(_playerActions.Interact); + Crouch = Register(_playerActions.Crouch); + Previous = Register(_playerActions.Previous); + Next = Register(_playerActions.Next); + } + + public void Initialize() + { + Disable(); + } + + public override void Enable() + { + base.Enable(); + _playerActions.Enable(); + } + + public override void Disable() + { + base.Disable(); + _playerActions.Disable(); + } + } +} + + diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/PlayerInput.cs.meta b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/PlayerInput.cs.meta new file mode 100644 index 0000000..ab9bdce --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/PlayerInput.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3f24c94d005646f18e40368665121d62 +timeCreated: 1770408676 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/UIInput.cs b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/UIInput.cs new file mode 100644 index 0000000..e81aded --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/UIInput.cs @@ -0,0 +1,49 @@ +using UnityEngine; + +using UIActions = UserInputAction.UIActions; + +namespace _Project.Develop.Runtime.Utils.InputManagement.Inputs +{ + public class UIInput : InputBase, IUIInput + { + public InputState Point { get; } + public InputState Navigate { get; } + public InputState Click { get; } + public InputState RightClick { get; } + public InputState MiddleClick { get; } + public InputState ScrollWheel { get; } + // public InputState DeviceOrientation { get; } + + private readonly UIActions _uiActions; + + public UIInput(UIActions uiActions) + { + _uiActions = uiActions; + + Point = Register(_uiActions.Point); + Navigate = Register(_uiActions.Navigate); + Click = Register(_uiActions.Click); + RightClick = Register(_uiActions.RightClick); + MiddleClick = Register(_uiActions.MiddleClick); + ScrollWheel = Register(_uiActions.ScrollWheel); + // DeviceOrientation = Register(_uiActions.TrackedDeviceOrientation); + } + + public void Initialize() + { + Disable(); + } + + public override void Enable() + { + base.Enable(); + _uiActions.Enable(); + } + + public override void Disable() + { + base.Disable(); + _uiActions.Disable(); + } + } +} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/UIInput.cs.meta b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/UIInput.cs.meta new file mode 100644 index 0000000..ede4b34 --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/Inputs/UIInput.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bdb01f1b865b461f816e8d4dff0c0aeb +timeCreated: 1770414125 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/RebindInputService.cs b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/RebindInputService.cs new file mode 100644 index 0000000..f97a938 --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/RebindInputService.cs @@ -0,0 +1,7 @@ +namespace _Project.Develop.Runtime.Utils.InputManagement +{ + public class RebindInputService + { + // ахаха захотел он смену клавиш + } +} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/InputManagement/RebindInputService.cs.meta b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/RebindInputService.cs.meta new file mode 100644 index 0000000..0b3e84a --- /dev/null +++ b/Assets/_Project/Develop/Runtime/Utilities/InputManagement/RebindInputService.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a0db421683434be6adebcb01ebb5b2ff +timeCreated: 1770413119 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/StateMachine/IStateChanger.cs b/Assets/_Project/Develop/Runtime/Utilities/StateMachine/IStateChanger.cs deleted file mode 100644 index d73c1b2..0000000 --- a/Assets/_Project/Develop/Runtime/Utilities/StateMachine/IStateChanger.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace _Project.Develop.Runtime.Utilities.StateMachine -{ - public interface IStateChanger - { - event Action Changed; - - StateMachine ChangeState() where TState : State; - } -} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/StateMachine/IStateChanger.cs.meta b/Assets/_Project/Develop/Runtime/Utilities/StateMachine/IStateChanger.cs.meta deleted file mode 100644 index be50b3f..0000000 --- a/Assets/_Project/Develop/Runtime/Utilities/StateMachine/IStateChanger.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 8b705c6047e545c483833a0fe80a6850 -timeCreated: 1770390018 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/StateMachine/State.cs b/Assets/_Project/Develop/Runtime/Utilities/StateMachine/State.cs deleted file mode 100644 index 8c9315c..0000000 --- a/Assets/_Project/Develop/Runtime/Utilities/StateMachine/State.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; - -namespace _Project.Develop.Runtime.Utilities.StateMachine -{ - public abstract class State - { - public event Action Entered; - - public event Action Exited; - - public virtual void OnEnter() => Entered?.Invoke(); - - public virtual void OnExit() => Exited?.Invoke(); - - public virtual void Update(float deltaTime) { } - } -} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/StateMachine/State.cs.meta b/Assets/_Project/Develop/Runtime/Utilities/StateMachine/State.cs.meta deleted file mode 100644 index 9b01e02..0000000 --- a/Assets/_Project/Develop/Runtime/Utilities/StateMachine/State.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 991e020273854d7683766af332608683 -timeCreated: 1770376146 \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/StateMachine/StateMachine.cs b/Assets/_Project/Develop/Runtime/Utilities/StateMachine/StateMachine.cs deleted file mode 100644 index 8c1ad5b..0000000 --- a/Assets/_Project/Develop/Runtime/Utilities/StateMachine/StateMachine.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace _Project.Develop.Runtime.Utilities.StateMachine -{ - public abstract class StateMachine : IStateChanger - { - public event Action Changed; - - public State Current { get; private set; } - - private readonly Dictionary _states = new(); - private bool _isRunning; - - public StateMachine(params State[] states) - { - foreach (State state in states) - Add(state); - } - - public void Update(float deltaTime) - { - if (_isRunning == false) - return; - - Current?.Update(deltaTime); - } - - public StateMachine Add(State state) - { - if (state == null) - throw new ArgumentNullException(nameof(state)); - - Type type = state.GetType(); - - if (_states.TryAdd(type, state) == false) - throw new InvalidOperationException($"[StateMachine] State {type.Name} is already registered"); - - return this; - } - - public StateMachine Remove() where TState : State - { - Type type = typeof(TState); - - if (_states.Remove(type) == false) - throw new InvalidOperationException($"[StateMachine] State {type.Name} is not registered"); - - return this; - } - - public StateMachine ChangeState() where TState : State - { - Type type = typeof(TState); - - if (_states.TryGetValue(type, out State state) == false) - throw new InvalidOperationException($"[StateMachine] State {type.Name} is not registered"); - - SwitchState(state); - - return this; - } - - private void SwitchState(State newState) - { - if (newState == null) - throw new ArgumentNullException(nameof(newState)); - - if (Current != null) - Current.OnExit(); - else - _isRunning = true; - - Current = newState; - Changed?.Invoke(Current); - Current.OnEnter(); - } - } -} \ No newline at end of file diff --git a/Assets/_Project/Develop/Runtime/Utilities/StateMachine.meta b/Assets/_Project/Develop/Runtime/Utilities/StatesManagement.meta similarity index 100% rename from Assets/_Project/Develop/Runtime/Utilities/StateMachine.meta rename to Assets/_Project/Develop/Runtime/Utilities/StatesManagement.meta diff --git a/Assets/_Project/Resources/Entities/TestEntity 1.prefab b/Assets/_Project/Resources/Entities/Ghost.prefab similarity index 99% rename from Assets/_Project/Resources/Entities/TestEntity 1.prefab rename to Assets/_Project/Resources/Entities/Ghost.prefab index d87d7ce..3ea097a 100644 --- a/Assets/_Project/Resources/Entities/TestEntity 1.prefab +++ b/Assets/_Project/Resources/Entities/Ghost.prefab @@ -98,7 +98,7 @@ GameObject: - component: {fileID: 6565447619237781124} - component: {fileID: 8643992716899077862} m_Layer: 0 - m_Name: TestEntity 1 + m_Name: Ghost m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 diff --git a/Assets/_Project/Resources/Entities/TestEntity 1.prefab.meta b/Assets/_Project/Resources/Entities/Ghost.prefab.meta similarity index 100% rename from Assets/_Project/Resources/Entities/TestEntity 1.prefab.meta rename to Assets/_Project/Resources/Entities/Ghost.prefab.meta diff --git a/Assets/_Project/Resources/Entities/TestEntity.prefab b/Assets/_Project/Resources/Entities/TestEntity.prefab deleted file mode 100644 index f991706..0000000 --- a/Assets/_Project/Resources/Entities/TestEntity.prefab +++ /dev/null @@ -1,312 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &6238656115224209256 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3482713960133750432} - - component: {fileID: 8626195749695403117} - - component: {fileID: 4032663711928052727} - m_Layer: 0 - m_Name: Sphere - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &3482713960133750432 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6238656115224209256} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0.3, z: 0.22} - m_LocalScale: {x: 1, y: 0.57116395, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 3729330896622341159} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &8626195749695403117 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6238656115224209256} - m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} ---- !u!23 &4032663711928052727 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6238656115224209256} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_StaticShadowCaster: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!1 &6344150908040749382 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3712880853837558930} - - component: {fileID: 7031502133547492830} - - component: {fileID: 6565447619237781124} - - component: {fileID: 8643992716899077862} - - component: {fileID: -3493177906804083266} - - component: {fileID: -5997931266940665224} - m_Layer: 0 - m_Name: TestEntity - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &3712880853837558930 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6344150908040749382} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 3729330896622341159} - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &7031502133547492830 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6344150908040749382} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0fa38a390e3026e4da73b8535ef0c601, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &6565447619237781124 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6344150908040749382} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b7fdeece4c60497ea61a1006e47bfbc5, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &8643992716899077862 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6344150908040749382} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: b3d77209b50f4ecf9185ae250a76b909, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!143 &-3493177906804083266 -CharacterController: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6344150908040749382} - m_Material: {fileID: 0} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_IsTrigger: 0 - m_ProvidesContacts: 0 - m_Enabled: 1 - serializedVersion: 3 - m_Height: 2 - m_Radius: 0.5 - m_SlopeLimit: 45 - m_StepOffset: 0.3 - m_SkinWidth: 0.08 - m_MinMoveDistance: 0.001 - m_Center: {x: 0, y: 0, z: 0} ---- !u!114 &-5997931266940665224 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6344150908040749382} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 901d0931c1074853a656db4b4364f490, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!1 &7421563490521616768 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 5801233178194481557} - - component: {fileID: 5626862109688605077} - - component: {fileID: 12644309328441543} - m_Layer: 0 - m_Name: Body - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &5801233178194481557 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7421563490521616768} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 0.83449, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 3729330896622341159} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &5626862109688605077 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7421563490521616768} - m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} ---- !u!23 &12644309328441543 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7421563490521616768} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_StaticShadowCaster: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!1 &8220022131449611056 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3729330896622341159} - m_Layer: 0 - m_Name: View - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &3729330896622341159 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8220022131449611056} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 5801233178194481557} - - {fileID: 3482713960133750432} - m_Father: {fileID: 3712880853837558930} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/_Project/Resources/Entities/TestEntity.prefab.meta b/Assets/_Project/Settings.meta similarity index 57% rename from Assets/_Project/Resources/Entities/TestEntity.prefab.meta rename to Assets/_Project/Settings.meta index bf7581e..7f11af4 100644 --- a/Assets/_Project/Resources/Entities/TestEntity.prefab.meta +++ b/Assets/_Project/Settings.meta @@ -1,6 +1,7 @@ fileFormatVersion: 2 -guid: 9db404a82293f814a96d2822f7663461 -PrefabImporter: +guid: 457e2ddf28e0cef47a8720c92fd48ace +folderAsset: yes +DefaultImporter: externalObjects: {} userData: assetBundleName: diff --git a/Assets/_Project/Settings/Input.meta b/Assets/_Project/Settings/Input.meta new file mode 100644 index 0000000..2ea4e38 --- /dev/null +++ b/Assets/_Project/Settings/Input.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 701cb31d37259ef4795a56b70918a7f0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Project/Settings/Input/UserInputAction.cs b/Assets/_Project/Settings/Input/UserInputAction.cs new file mode 100644 index 0000000..a84bbe1 --- /dev/null +++ b/Assets/_Project/Settings/Input/UserInputAction.cs @@ -0,0 +1,1459 @@ +//------------------------------------------------------------------------------ +// +// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator +// version 1.7.0 +// from Assets/_Project/Settings/Input/UserInputAction.inputactions +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine.InputSystem; +using UnityEngine.InputSystem.Utilities; + +public partial class @UserInputAction: IInputActionCollection2, IDisposable +{ + public InputActionAsset asset { get; } + public @UserInputAction() + { + asset = InputActionAsset.FromJson(@"{ + ""name"": ""UserInputAction"", + ""maps"": [ + { + ""name"": ""Player"", + ""id"": ""632b6da8-9cd9-4b5d-9654-3101fc871d09"", + ""actions"": [ + { + ""name"": ""Move"", + ""type"": ""Value"", + ""id"": ""c060b7dd-d27d-4e8c-a90a-20a0be62d752"", + ""expectedControlType"": ""Vector2"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": true + }, + { + ""name"": ""Look"", + ""type"": ""Value"", + ""id"": ""3fbfd88d-c30c-495e-876d-6be6cc8cd451"", + ""expectedControlType"": ""Vector2"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": true + }, + { + ""name"": ""Attack"", + ""type"": ""Button"", + ""id"": ""ec39bf87-fe05-4c8c-a19f-d84d2daf6300"", + ""expectedControlType"": """", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""Interact"", + ""type"": ""Button"", + ""id"": ""0b61cf8f-47d6-40f1-9033-5be366a32df8"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": ""Hold"", + ""initialStateCheck"": false + }, + { + ""name"": ""Crouch"", + ""type"": ""Button"", + ""id"": ""84f366d3-1307-4725-a4f6-b1a81b68eb3c"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""Jump"", + ""type"": ""Button"", + ""id"": ""be18e62b-7bff-4d90-ad67-4a2111bfd28b"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""Previous"", + ""type"": ""Button"", + ""id"": ""7f84b5b3-5334-4b80-952d-2f0e4f9bbad9"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""Next"", + ""type"": ""Button"", + ""id"": ""be336704-a967-48c9-b4f6-9be891fe94e5"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""Sprint"", + ""type"": ""Button"", + ""id"": ""1e784e65-87e9-414b-bd1d-60a2eb583571"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + } + ], + ""bindings"": [ + { + ""name"": """", + ""id"": ""253005ce-4c02-48bd-85b4-4ad10ac81d39"", + ""path"": ""/leftStick"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Gamepad;All"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": ""WASD"", + ""id"": ""f94d9f16-83b9-454f-ad03-63508a4266c4"", + ""path"": ""Dpad"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Move"", + ""isComposite"": true, + ""isPartOfComposite"": false + }, + { + ""name"": ""up"", + ""id"": ""346457ae-44aa-444c-8a6c-8485a902a251"", + ""path"": ""/w"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Keyboard&Mouse"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""up"", + ""id"": ""7f4fb235-2b92-4cdf-8a7a-8f0ba33456d0"", + ""path"": ""/upArrow"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Keyboard&Mouse"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""down"", + ""id"": ""b098e733-d22e-46a2-8eb3-621a9e2b08b1"", + ""path"": ""/s"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Keyboard&Mouse"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""down"", + ""id"": ""61c85960-e323-4bf2-89c8-f6c9cc5a9082"", + ""path"": ""/downArrow"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Keyboard&Mouse"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""left"", + ""id"": ""8b7b4b16-64d7-4684-b765-dd373f3db36b"", + ""path"": ""/a"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Keyboard&Mouse"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""left"", + ""id"": ""effe73ca-42ca-4ef9-b332-46033721db19"", + ""path"": ""/leftArrow"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Keyboard&Mouse"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""right"", + ""id"": ""a6106718-034d-44ea-b6c8-16e27484ec03"", + ""path"": ""/d"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Keyboard&Mouse"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""right"", + ""id"": ""629d3b58-a5ea-4af0-baf9-7789482e53eb"", + ""path"": ""/rightArrow"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Keyboard&Mouse"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": """", + ""id"": ""86e8892e-424e-4da9-864d-ffb06448f426"", + ""path"": ""/{Primary2DAxis}"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""XR;All"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""d8d7a2e7-3efb-483e-9824-c8496187f19c"", + ""path"": ""/stick"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Joystick;All"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""c85b6852-da9e-4e42-8dc9-9b7132755518"", + ""path"": ""/rightStick"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Gamepad"", + ""action"": ""Look"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""7ceac3f0-d22d-4650-8713-98e2a9035d44"", + ""path"": ""/delta"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Keyboard&Mouse;Touch"", + ""action"": ""Look"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""e7648906-0e22-485d-9873-a72aec3bd015"", + ""path"": ""/{Hatswitch}"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Joystick"", + ""action"": ""Look"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""1b76c4ae-fd90-4c59-930d-5e129235588d"", + ""path"": ""/buttonWest"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Gamepad"", + ""action"": ""Attack"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""5929a281-4143-4290-86aa-4bb3ad4525b3"", + ""path"": ""/leftButton"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Keyboard&Mouse"", + ""action"": ""Attack"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""8be4847d-7e0b-45b6-bcca-a73b370655e3"", + ""path"": ""/primaryTouch/tap"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Touch"", + ""action"": ""Attack"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""440784be-ff21-463a-9866-4b262e577dee"", + ""path"": ""/trigger"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Joystick"", + ""action"": ""Attack"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""3cd27db6-663e-4cc4-8a82-a1140c402a1c"", + ""path"": ""/{PrimaryAction}"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""XR"", + ""action"": ""Attack"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""1d064e1e-99d3-4a76-8085-f52793ce4391"", + ""path"": ""/enter"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""Attack"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""e3fa0b41-17a1-4fba-bf5c-0e5d784574f6"", + ""path"": ""/2"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""Next"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""efab9770-1274-41a7-abac-dd8c7a30715b"", + ""path"": ""/dpad/right"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Gamepad"", + ""action"": ""Next"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""411d2f6b-3ea0-4494-9a12-b09c26b0f476"", + ""path"": ""/leftShift"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""Sprint"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""00e19607-f01e-4554-8d4c-48286554739a"", + ""path"": ""/leftStickPress"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Gamepad"", + ""action"": ""Sprint"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""d805de75-193c-4309-82cd-0551e017cc1a"", + ""path"": ""/trigger"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""XR"", + ""action"": ""Sprint"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""ed2432a4-2f77-432f-9139-7342d112b129"", + ""path"": ""/space"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""Jump"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""961d648f-d94a-4355-b434-11922696108f"", + ""path"": ""/buttonSouth"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Gamepad"", + ""action"": ""Jump"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""97dcbb91-1cbb-4093-8216-24449eb2791b"", + ""path"": ""/secondaryButton"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""XR"", + ""action"": ""Jump"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""c80a7c4a-2d2c-4274-872a-62ce8fcdbfd3"", + ""path"": ""/1"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""Previous"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""13e6a93b-b479-4ce5-907d-1fec410de53b"", + ""path"": ""/dpad/left"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Gamepad"", + ""action"": ""Previous"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""b0ad6d55-d843-457a-901d-46f928cb0c26"", + ""path"": ""/e"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""Interact"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""093d59a4-3bce-4e41-a215-b5a0e567b01a"", + ""path"": ""/buttonNorth"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Gamepad"", + ""action"": ""Interact"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""637758ea-f982-4060-b06a-0f0c7c8d8ad3"", + ""path"": ""/buttonEast"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Gamepad"", + ""action"": ""Crouch"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""19dcc6ab-1a7e-447d-a9f9-3325e00d715c"", + ""path"": ""/c"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""Crouch"", + ""isComposite"": false, + ""isPartOfComposite"": false + } + ] + }, + { + ""name"": ""UI"", + ""id"": ""b078530f-faa4-449d-adc7-f09369ff9708"", + ""actions"": [ + { + ""name"": ""Navigate"", + ""type"": ""PassThrough"", + ""id"": ""2fc2ad40-3973-442d-8e65-89bcbcd13cb3"", + ""expectedControlType"": ""Vector2"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""Submit"", + ""type"": ""Button"", + ""id"": ""3cc811da-27c3-4bbc-889e-0ef1f2a2f492"", + ""expectedControlType"": """", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""Cancel"", + ""type"": ""Button"", + ""id"": ""e2c896b5-195d-48b9-a9aa-db74a36484db"", + ""expectedControlType"": """", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""Point"", + ""type"": ""PassThrough"", + ""id"": ""b360b519-650c-4236-891e-cfe136d16357"", + ""expectedControlType"": ""Vector2"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": true + }, + { + ""name"": ""Click"", + ""type"": ""PassThrough"", + ""id"": ""f0f2e40f-40f3-4159-af9c-2a3fe7c1eb97"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": true + }, + { + ""name"": ""RightClick"", + ""type"": ""PassThrough"", + ""id"": ""e128bdd7-e9cf-47c1-9144-4f67f73dcdb6"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""MiddleClick"", + ""type"": ""PassThrough"", + ""id"": ""5a926f79-155b-4338-b5aa-fa9a3f3aed05"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""ScrollWheel"", + ""type"": ""PassThrough"", + ""id"": ""06c553e3-6557-48be-a2a9-0f5b0175ddee"", + ""expectedControlType"": ""Vector2"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""TrackedDevicePosition"", + ""type"": ""PassThrough"", + ""id"": ""64b04542-aa38-4080-9d28-b306af1b0fb4"", + ""expectedControlType"": ""Vector3"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + }, + { + ""name"": ""TrackedDeviceOrientation"", + ""type"": ""PassThrough"", + ""id"": ""f96a5843-b937-439e-9e6b-4cd978ecd871"", + ""expectedControlType"": ""Quaternion"", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + } + ], + ""bindings"": [ + { + ""name"": ""Gamepad"", + ""id"": ""e054a09e-24f5-4e50-b660-97af056d5855"", + ""path"": ""2DVector"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": true, + ""isPartOfComposite"": false + }, + { + ""name"": ""up"", + ""id"": ""56c9af2b-11d6-4180-a3c8-3efd8c0eca10"", + ""path"": ""/leftStick/up"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Gamepad"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""up"", + ""id"": ""06306b52-7d98-4bb2-86a4-3e2527677ecb"", + ""path"": ""/rightStick/up"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Gamepad"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""down"", + ""id"": ""3b4458ed-f6d6-4deb-996f-9c724bae57c0"", + ""path"": ""/leftStick/down"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Gamepad"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""down"", + ""id"": ""c76ae3c2-1d0d-4149-be3b-137540eacb8f"", + ""path"": ""/rightStick/down"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Gamepad"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""left"", + ""id"": ""bb5decf2-953d-4522-a869-54296e6753ea"", + ""path"": ""/leftStick/left"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Gamepad"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""left"", + ""id"": ""96a0d137-ff3d-4963-b25b-e0c6f05beafb"", + ""path"": ""/rightStick/left"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Gamepad"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""right"", + ""id"": ""452f9adb-827c-440b-b53b-dc92977468e3"", + ""path"": ""/leftStick/right"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Gamepad"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""right"", + ""id"": ""89add4d1-e424-4815-9527-afc073b35b35"", + ""path"": ""/rightStick/right"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Gamepad"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": """", + ""id"": ""9207470b-036c-449d-a48f-3bd265be3752"", + ""path"": ""/dpad"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Gamepad"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": ""Joystick"", + ""id"": ""f3ffed66-d8a4-40bf-86c5-1bc6f74067a3"", + ""path"": ""2DVector"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": true, + ""isPartOfComposite"": false + }, + { + ""name"": ""up"", + ""id"": ""1e05bd28-8b67-4297-afc8-9c70c4b24acc"", + ""path"": ""/stick/up"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Joystick"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""down"", + ""id"": ""c2f41ef9-9995-4e35-a849-8096b64b7057"", + ""path"": ""/stick/down"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Joystick"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""left"", + ""id"": ""1329bbc2-fd9a-427c-8b42-b9a901cca776"", + ""path"": ""/stick/left"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Joystick"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""right"", + ""id"": ""8c932013-a7e3-4b3a-a74e-58244d62f4b3"", + ""path"": ""/stick/right"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Joystick"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""Keyboard"", + ""id"": ""aee67287-82f5-4880-8bee-34d87d80e27e"", + ""path"": ""2DVector"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Navigate"", + ""isComposite"": true, + ""isPartOfComposite"": false + }, + { + ""name"": ""up"", + ""id"": ""c4009a36-4a5e-42eb-8e93-215e5cfebcc7"", + ""path"": ""/w"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""up"", + ""id"": ""1a38639e-6b49-40f0-98f5-5a591f4583ac"", + ""path"": ""/upArrow"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""down"", + ""id"": ""097204c3-b95d-47ef-9053-0fbf07d2b767"", + ""path"": ""/s"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""down"", + ""id"": ""eaa42b6b-3b54-4663-bd80-e86fccbf0908"", + ""path"": ""/downArrow"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""left"", + ""id"": ""374862dc-0a59-4ba5-b9d2-e7379383ca04"", + ""path"": ""/a"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""left"", + ""id"": ""d83646dd-2ab4-4bdb-b497-fa01cba17e4b"", + ""path"": ""/leftArrow"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""right"", + ""id"": ""32b0f72c-dc8f-4047-b00d-84e314cc33c1"", + ""path"": ""/d"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""right"", + ""id"": ""6ab3b966-70bf-4724-9abf-e80418e500f0"", + ""path"": ""/rightArrow"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""Navigate"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": """", + ""id"": ""20a5a774-bb54-4d1c-9f88-101ef11ab6ba"", + ""path"": ""*/{Submit}"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse;Gamepad;Touch;Joystick;XR"", + ""action"": ""Submit"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""c2502c3e-33ff-4306-8ee0-67321c4b48e9"", + ""path"": ""*/{Cancel}"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse;Gamepad;Touch;Joystick;XR"", + ""action"": ""Cancel"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""f5b877ec-d80b-4f21-a76c-188f5f21b426"", + ""path"": ""/position"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""Point"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""cb88e2e8-e45a-4162-a04c-f5e222d0ca09"", + ""path"": ""/position"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""Point"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""c2ed42be-b26a-4b30-9548-5995312e6027"", + ""path"": ""/touch*/position"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Touch"", + ""action"": ""Point"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""9417ec75-7652-46b5-9ad6-c158545a480f"", + ""path"": ""/leftButton"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Keyboard&Mouse"", + ""action"": ""Click"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""ec941567-2fdb-412d-a8da-1c5571f88754"", + ""path"": ""/tip"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Keyboard&Mouse"", + ""action"": ""Click"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""ce959143-b843-4122-a82f-79fe27044e74"", + ""path"": ""/touch*/press"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Touch"", + ""action"": ""Click"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""cfeb81b7-5e79-480b-8ebf-db7ff6f11384"", + ""path"": ""/trigger"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""XR"", + ""action"": ""Click"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""5c81c597-70c4-4ae8-8656-55a49a65e04e"", + ""path"": ""/scroll"", + ""interactions"": """", + ""processors"": """", + ""groups"": "";Keyboard&Mouse"", + ""action"": ""ScrollWheel"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""bef090d3-f9d2-4050-a004-b7f16a9e00ce"", + ""path"": ""/rightButton"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""RightClick"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""850fc93c-6d06-4467-a406-09231958d851"", + ""path"": ""/middleButton"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard&Mouse"", + ""action"": ""MiddleClick"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""0eab82c1-ea93-4a34-9677-d13f9c717202"", + ""path"": ""/devicePosition"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""XR"", + ""action"": ""TrackedDevicePosition"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""cd8f5ca0-aa01-4fa2-8b60-30635900cc68"", + ""path"": ""/deviceRotation"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""XR"", + ""action"": ""TrackedDeviceOrientation"", + ""isComposite"": false, + ""isPartOfComposite"": false + } + ] + }, + { + ""name"": ""Develop"", + ""id"": ""329ad99c-9b81-449f-88c0-15d64101c864"", + ""actions"": [ + { + ""name"": ""Tilda"", + ""type"": ""Button"", + ""id"": ""8f5f5dcc-36f8-43c8-9574-0a3592da0c6a"", + ""expectedControlType"": """", + ""processors"": """", + ""interactions"": """", + ""initialStateCheck"": false + } + ], + ""bindings"": [ + { + ""name"": """", + ""id"": ""0cc22a3b-89bc-4af9-b636-818cc91deba0"", + ""path"": ""/backquote"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Tilda"", + ""isComposite"": false, + ""isPartOfComposite"": false + } + ] + } + ], + ""controlSchemes"": [ + { + ""name"": ""All"", + ""bindingGroup"": ""All"", + ""devices"": [ + { + ""devicePath"": """", + ""isOptional"": false, + ""isOR"": false + }, + { + ""devicePath"": """", + ""isOptional"": false, + ""isOR"": false + } + ] + } + ] +}"); + // Player + m_Player = asset.FindActionMap("Player", throwIfNotFound: true); + m_Player_Move = m_Player.FindAction("Move", throwIfNotFound: true); + m_Player_Look = m_Player.FindAction("Look", throwIfNotFound: true); + m_Player_Attack = m_Player.FindAction("Attack", throwIfNotFound: true); + m_Player_Interact = m_Player.FindAction("Interact", throwIfNotFound: true); + m_Player_Crouch = m_Player.FindAction("Crouch", throwIfNotFound: true); + m_Player_Jump = m_Player.FindAction("Jump", throwIfNotFound: true); + m_Player_Previous = m_Player.FindAction("Previous", throwIfNotFound: true); + m_Player_Next = m_Player.FindAction("Next", throwIfNotFound: true); + m_Player_Sprint = m_Player.FindAction("Sprint", throwIfNotFound: true); + // UI + m_UI = asset.FindActionMap("UI", throwIfNotFound: true); + m_UI_Navigate = m_UI.FindAction("Navigate", throwIfNotFound: true); + m_UI_Submit = m_UI.FindAction("Submit", throwIfNotFound: true); + m_UI_Cancel = m_UI.FindAction("Cancel", throwIfNotFound: true); + m_UI_Point = m_UI.FindAction("Point", throwIfNotFound: true); + m_UI_Click = m_UI.FindAction("Click", throwIfNotFound: true); + m_UI_RightClick = m_UI.FindAction("RightClick", throwIfNotFound: true); + m_UI_MiddleClick = m_UI.FindAction("MiddleClick", throwIfNotFound: true); + m_UI_ScrollWheel = m_UI.FindAction("ScrollWheel", throwIfNotFound: true); + m_UI_TrackedDevicePosition = m_UI.FindAction("TrackedDevicePosition", throwIfNotFound: true); + m_UI_TrackedDeviceOrientation = m_UI.FindAction("TrackedDeviceOrientation", throwIfNotFound: true); + // Develop + m_Develop = asset.FindActionMap("Develop", throwIfNotFound: true); + m_Develop_Tilda = m_Develop.FindAction("Tilda", throwIfNotFound: true); + } + + public void Dispose() + { + UnityEngine.Object.Destroy(asset); + } + + public InputBinding? bindingMask + { + get => asset.bindingMask; + set => asset.bindingMask = value; + } + + public ReadOnlyArray? devices + { + get => asset.devices; + set => asset.devices = value; + } + + public ReadOnlyArray controlSchemes => asset.controlSchemes; + + public bool Contains(InputAction action) + { + return asset.Contains(action); + } + + public IEnumerator GetEnumerator() + { + return asset.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Enable() + { + asset.Enable(); + } + + public void Disable() + { + asset.Disable(); + } + + public IEnumerable bindings => asset.bindings; + + public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false) + { + return asset.FindAction(actionNameOrId, throwIfNotFound); + } + + public int FindBinding(InputBinding bindingMask, out InputAction action) + { + return asset.FindBinding(bindingMask, out action); + } + + // Player + private readonly InputActionMap m_Player; + private List m_PlayerActionsCallbackInterfaces = new List(); + private readonly InputAction m_Player_Move; + private readonly InputAction m_Player_Look; + private readonly InputAction m_Player_Attack; + private readonly InputAction m_Player_Interact; + private readonly InputAction m_Player_Crouch; + private readonly InputAction m_Player_Jump; + private readonly InputAction m_Player_Previous; + private readonly InputAction m_Player_Next; + private readonly InputAction m_Player_Sprint; + public struct PlayerActions + { + private @UserInputAction m_Wrapper; + public PlayerActions(@UserInputAction wrapper) { m_Wrapper = wrapper; } + public InputAction @Move => m_Wrapper.m_Player_Move; + public InputAction @Look => m_Wrapper.m_Player_Look; + public InputAction @Attack => m_Wrapper.m_Player_Attack; + public InputAction @Interact => m_Wrapper.m_Player_Interact; + public InputAction @Crouch => m_Wrapper.m_Player_Crouch; + public InputAction @Jump => m_Wrapper.m_Player_Jump; + public InputAction @Previous => m_Wrapper.m_Player_Previous; + public InputAction @Next => m_Wrapper.m_Player_Next; + public InputAction @Sprint => m_Wrapper.m_Player_Sprint; + public InputActionMap Get() { return m_Wrapper.m_Player; } + public void Enable() { Get().Enable(); } + public void Disable() { Get().Disable(); } + public bool enabled => Get().enabled; + public static implicit operator InputActionMap(PlayerActions set) { return set.Get(); } + public void AddCallbacks(IPlayerActions instance) + { + if (instance == null || m_Wrapper.m_PlayerActionsCallbackInterfaces.Contains(instance)) return; + m_Wrapper.m_PlayerActionsCallbackInterfaces.Add(instance); + @Move.started += instance.OnMove; + @Move.performed += instance.OnMove; + @Move.canceled += instance.OnMove; + @Look.started += instance.OnLook; + @Look.performed += instance.OnLook; + @Look.canceled += instance.OnLook; + @Attack.started += instance.OnAttack; + @Attack.performed += instance.OnAttack; + @Attack.canceled += instance.OnAttack; + @Interact.started += instance.OnInteract; + @Interact.performed += instance.OnInteract; + @Interact.canceled += instance.OnInteract; + @Crouch.started += instance.OnCrouch; + @Crouch.performed += instance.OnCrouch; + @Crouch.canceled += instance.OnCrouch; + @Jump.started += instance.OnJump; + @Jump.performed += instance.OnJump; + @Jump.canceled += instance.OnJump; + @Previous.started += instance.OnPrevious; + @Previous.performed += instance.OnPrevious; + @Previous.canceled += instance.OnPrevious; + @Next.started += instance.OnNext; + @Next.performed += instance.OnNext; + @Next.canceled += instance.OnNext; + @Sprint.started += instance.OnSprint; + @Sprint.performed += instance.OnSprint; + @Sprint.canceled += instance.OnSprint; + } + + private void UnregisterCallbacks(IPlayerActions instance) + { + @Move.started -= instance.OnMove; + @Move.performed -= instance.OnMove; + @Move.canceled -= instance.OnMove; + @Look.started -= instance.OnLook; + @Look.performed -= instance.OnLook; + @Look.canceled -= instance.OnLook; + @Attack.started -= instance.OnAttack; + @Attack.performed -= instance.OnAttack; + @Attack.canceled -= instance.OnAttack; + @Interact.started -= instance.OnInteract; + @Interact.performed -= instance.OnInteract; + @Interact.canceled -= instance.OnInteract; + @Crouch.started -= instance.OnCrouch; + @Crouch.performed -= instance.OnCrouch; + @Crouch.canceled -= instance.OnCrouch; + @Jump.started -= instance.OnJump; + @Jump.performed -= instance.OnJump; + @Jump.canceled -= instance.OnJump; + @Previous.started -= instance.OnPrevious; + @Previous.performed -= instance.OnPrevious; + @Previous.canceled -= instance.OnPrevious; + @Next.started -= instance.OnNext; + @Next.performed -= instance.OnNext; + @Next.canceled -= instance.OnNext; + @Sprint.started -= instance.OnSprint; + @Sprint.performed -= instance.OnSprint; + @Sprint.canceled -= instance.OnSprint; + } + + public void RemoveCallbacks(IPlayerActions instance) + { + if (m_Wrapper.m_PlayerActionsCallbackInterfaces.Remove(instance)) + UnregisterCallbacks(instance); + } + + public void SetCallbacks(IPlayerActions instance) + { + foreach (var item in m_Wrapper.m_PlayerActionsCallbackInterfaces) + UnregisterCallbacks(item); + m_Wrapper.m_PlayerActionsCallbackInterfaces.Clear(); + AddCallbacks(instance); + } + } + public PlayerActions @Player => new PlayerActions(this); + + // UI + private readonly InputActionMap m_UI; + private List m_UIActionsCallbackInterfaces = new List(); + private readonly InputAction m_UI_Navigate; + private readonly InputAction m_UI_Submit; + private readonly InputAction m_UI_Cancel; + private readonly InputAction m_UI_Point; + private readonly InputAction m_UI_Click; + private readonly InputAction m_UI_RightClick; + private readonly InputAction m_UI_MiddleClick; + private readonly InputAction m_UI_ScrollWheel; + private readonly InputAction m_UI_TrackedDevicePosition; + private readonly InputAction m_UI_TrackedDeviceOrientation; + public struct UIActions + { + private @UserInputAction m_Wrapper; + public UIActions(@UserInputAction wrapper) { m_Wrapper = wrapper; } + public InputAction @Navigate => m_Wrapper.m_UI_Navigate; + public InputAction @Submit => m_Wrapper.m_UI_Submit; + public InputAction @Cancel => m_Wrapper.m_UI_Cancel; + public InputAction @Point => m_Wrapper.m_UI_Point; + public InputAction @Click => m_Wrapper.m_UI_Click; + public InputAction @RightClick => m_Wrapper.m_UI_RightClick; + public InputAction @MiddleClick => m_Wrapper.m_UI_MiddleClick; + public InputAction @ScrollWheel => m_Wrapper.m_UI_ScrollWheel; + public InputAction @TrackedDevicePosition => m_Wrapper.m_UI_TrackedDevicePosition; + public InputAction @TrackedDeviceOrientation => m_Wrapper.m_UI_TrackedDeviceOrientation; + public InputActionMap Get() { return m_Wrapper.m_UI; } + public void Enable() { Get().Enable(); } + public void Disable() { Get().Disable(); } + public bool enabled => Get().enabled; + public static implicit operator InputActionMap(UIActions set) { return set.Get(); } + public void AddCallbacks(IUIActions instance) + { + if (instance == null || m_Wrapper.m_UIActionsCallbackInterfaces.Contains(instance)) return; + m_Wrapper.m_UIActionsCallbackInterfaces.Add(instance); + @Navigate.started += instance.OnNavigate; + @Navigate.performed += instance.OnNavigate; + @Navigate.canceled += instance.OnNavigate; + @Submit.started += instance.OnSubmit; + @Submit.performed += instance.OnSubmit; + @Submit.canceled += instance.OnSubmit; + @Cancel.started += instance.OnCancel; + @Cancel.performed += instance.OnCancel; + @Cancel.canceled += instance.OnCancel; + @Point.started += instance.OnPoint; + @Point.performed += instance.OnPoint; + @Point.canceled += instance.OnPoint; + @Click.started += instance.OnClick; + @Click.performed += instance.OnClick; + @Click.canceled += instance.OnClick; + @RightClick.started += instance.OnRightClick; + @RightClick.performed += instance.OnRightClick; + @RightClick.canceled += instance.OnRightClick; + @MiddleClick.started += instance.OnMiddleClick; + @MiddleClick.performed += instance.OnMiddleClick; + @MiddleClick.canceled += instance.OnMiddleClick; + @ScrollWheel.started += instance.OnScrollWheel; + @ScrollWheel.performed += instance.OnScrollWheel; + @ScrollWheel.canceled += instance.OnScrollWheel; + @TrackedDevicePosition.started += instance.OnTrackedDevicePosition; + @TrackedDevicePosition.performed += instance.OnTrackedDevicePosition; + @TrackedDevicePosition.canceled += instance.OnTrackedDevicePosition; + @TrackedDeviceOrientation.started += instance.OnTrackedDeviceOrientation; + @TrackedDeviceOrientation.performed += instance.OnTrackedDeviceOrientation; + @TrackedDeviceOrientation.canceled += instance.OnTrackedDeviceOrientation; + } + + private void UnregisterCallbacks(IUIActions instance) + { + @Navigate.started -= instance.OnNavigate; + @Navigate.performed -= instance.OnNavigate; + @Navigate.canceled -= instance.OnNavigate; + @Submit.started -= instance.OnSubmit; + @Submit.performed -= instance.OnSubmit; + @Submit.canceled -= instance.OnSubmit; + @Cancel.started -= instance.OnCancel; + @Cancel.performed -= instance.OnCancel; + @Cancel.canceled -= instance.OnCancel; + @Point.started -= instance.OnPoint; + @Point.performed -= instance.OnPoint; + @Point.canceled -= instance.OnPoint; + @Click.started -= instance.OnClick; + @Click.performed -= instance.OnClick; + @Click.canceled -= instance.OnClick; + @RightClick.started -= instance.OnRightClick; + @RightClick.performed -= instance.OnRightClick; + @RightClick.canceled -= instance.OnRightClick; + @MiddleClick.started -= instance.OnMiddleClick; + @MiddleClick.performed -= instance.OnMiddleClick; + @MiddleClick.canceled -= instance.OnMiddleClick; + @ScrollWheel.started -= instance.OnScrollWheel; + @ScrollWheel.performed -= instance.OnScrollWheel; + @ScrollWheel.canceled -= instance.OnScrollWheel; + @TrackedDevicePosition.started -= instance.OnTrackedDevicePosition; + @TrackedDevicePosition.performed -= instance.OnTrackedDevicePosition; + @TrackedDevicePosition.canceled -= instance.OnTrackedDevicePosition; + @TrackedDeviceOrientation.started -= instance.OnTrackedDeviceOrientation; + @TrackedDeviceOrientation.performed -= instance.OnTrackedDeviceOrientation; + @TrackedDeviceOrientation.canceled -= instance.OnTrackedDeviceOrientation; + } + + public void RemoveCallbacks(IUIActions instance) + { + if (m_Wrapper.m_UIActionsCallbackInterfaces.Remove(instance)) + UnregisterCallbacks(instance); + } + + public void SetCallbacks(IUIActions instance) + { + foreach (var item in m_Wrapper.m_UIActionsCallbackInterfaces) + UnregisterCallbacks(item); + m_Wrapper.m_UIActionsCallbackInterfaces.Clear(); + AddCallbacks(instance); + } + } + public UIActions @UI => new UIActions(this); + + // Develop + private readonly InputActionMap m_Develop; + private List m_DevelopActionsCallbackInterfaces = new List(); + private readonly InputAction m_Develop_Tilda; + public struct DevelopActions + { + private @UserInputAction m_Wrapper; + public DevelopActions(@UserInputAction wrapper) { m_Wrapper = wrapper; } + public InputAction @Tilda => m_Wrapper.m_Develop_Tilda; + public InputActionMap Get() { return m_Wrapper.m_Develop; } + public void Enable() { Get().Enable(); } + public void Disable() { Get().Disable(); } + public bool enabled => Get().enabled; + public static implicit operator InputActionMap(DevelopActions set) { return set.Get(); } + public void AddCallbacks(IDevelopActions instance) + { + if (instance == null || m_Wrapper.m_DevelopActionsCallbackInterfaces.Contains(instance)) return; + m_Wrapper.m_DevelopActionsCallbackInterfaces.Add(instance); + @Tilda.started += instance.OnTilda; + @Tilda.performed += instance.OnTilda; + @Tilda.canceled += instance.OnTilda; + } + + private void UnregisterCallbacks(IDevelopActions instance) + { + @Tilda.started -= instance.OnTilda; + @Tilda.performed -= instance.OnTilda; + @Tilda.canceled -= instance.OnTilda; + } + + public void RemoveCallbacks(IDevelopActions instance) + { + if (m_Wrapper.m_DevelopActionsCallbackInterfaces.Remove(instance)) + UnregisterCallbacks(instance); + } + + public void SetCallbacks(IDevelopActions instance) + { + foreach (var item in m_Wrapper.m_DevelopActionsCallbackInterfaces) + UnregisterCallbacks(item); + m_Wrapper.m_DevelopActionsCallbackInterfaces.Clear(); + AddCallbacks(instance); + } + } + public DevelopActions @Develop => new DevelopActions(this); + private int m_AllSchemeIndex = -1; + public InputControlScheme AllScheme + { + get + { + if (m_AllSchemeIndex == -1) m_AllSchemeIndex = asset.FindControlSchemeIndex("All"); + return asset.controlSchemes[m_AllSchemeIndex]; + } + } + public interface IPlayerActions + { + void OnMove(InputAction.CallbackContext context); + void OnLook(InputAction.CallbackContext context); + void OnAttack(InputAction.CallbackContext context); + void OnInteract(InputAction.CallbackContext context); + void OnCrouch(InputAction.CallbackContext context); + void OnJump(InputAction.CallbackContext context); + void OnPrevious(InputAction.CallbackContext context); + void OnNext(InputAction.CallbackContext context); + void OnSprint(InputAction.CallbackContext context); + } + public interface IUIActions + { + void OnNavigate(InputAction.CallbackContext context); + void OnSubmit(InputAction.CallbackContext context); + void OnCancel(InputAction.CallbackContext context); + void OnPoint(InputAction.CallbackContext context); + void OnClick(InputAction.CallbackContext context); + void OnRightClick(InputAction.CallbackContext context); + void OnMiddleClick(InputAction.CallbackContext context); + void OnScrollWheel(InputAction.CallbackContext context); + void OnTrackedDevicePosition(InputAction.CallbackContext context); + void OnTrackedDeviceOrientation(InputAction.CallbackContext context); + } + public interface IDevelopActions + { + void OnTilda(InputAction.CallbackContext context); + } +} diff --git a/Assets/_Project/Develop/Runtime/Utilities/StateMachine/StateMachine.cs.meta b/Assets/_Project/Settings/Input/UserInputAction.cs.meta similarity index 83% rename from Assets/_Project/Develop/Runtime/Utilities/StateMachine/StateMachine.cs.meta rename to Assets/_Project/Settings/Input/UserInputAction.cs.meta index d4f22c0..d79759b 100644 --- a/Assets/_Project/Develop/Runtime/Utilities/StateMachine/StateMachine.cs.meta +++ b/Assets/_Project/Settings/Input/UserInputAction.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4a9e1e9ad9be48b083a7678034b4312e +guid: 7c4feabd47afc37499ace985599e68d5 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/_Project/Settings/Input/UserInputAction.inputactions b/Assets/_Project/Settings/Input/UserInputAction.inputactions new file mode 100644 index 0000000..485f7c7 --- /dev/null +++ b/Assets/_Project/Settings/Input/UserInputAction.inputactions @@ -0,0 +1,1042 @@ +{ + "version": 1, + "name": "UserInput", + "maps": [ + { + "name": "Player", + "id": "632b6da8-9cd9-4b5d-9654-3101fc871d09", + "actions": [ + { + "name": "Move", + "type": "Value", + "id": "c060b7dd-d27d-4e8c-a90a-20a0be62d752", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "Look", + "type": "Value", + "id": "3fbfd88d-c30c-495e-876d-6be6cc8cd451", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "Attack", + "type": "Button", + "id": "ec39bf87-fe05-4c8c-a19f-d84d2daf6300", + "expectedControlType": "", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Interact", + "type": "Button", + "id": "0b61cf8f-47d6-40f1-9033-5be366a32df8", + "expectedControlType": "Button", + "processors": "", + "interactions": "Hold", + "initialStateCheck": false + }, + { + "name": "Crouch", + "type": "Button", + "id": "84f366d3-1307-4725-a4f6-b1a81b68eb3c", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Jump", + "type": "Button", + "id": "be18e62b-7bff-4d90-ad67-4a2111bfd28b", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Previous", + "type": "Button", + "id": "7f84b5b3-5334-4b80-952d-2f0e4f9bbad9", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Next", + "type": "Button", + "id": "be336704-a967-48c9-b4f6-9be891fe94e5", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Sprint", + "type": "Button", + "id": "1e784e65-87e9-414b-bd1d-60a2eb583571", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + } + ], + "bindings": [ + { + "name": "", + "id": "253005ce-4c02-48bd-85b4-4ad10ac81d39", + "path": "/leftStick", + "interactions": "", + "processors": "", + "groups": ";Gamepad;All", + "action": "Move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "WASD", + "id": "f94d9f16-83b9-454f-ad03-63508a4266c4", + "path": "Dpad", + "interactions": "", + "processors": "", + "groups": "", + "action": "Move", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "346457ae-44aa-444c-8a6c-8485a902a251", + "path": "/w", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "7f4fb235-2b92-4cdf-8a7a-8f0ba33456d0", + "path": "/upArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "b098e733-d22e-46a2-8eb3-621a9e2b08b1", + "path": "/s", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "61c85960-e323-4bf2-89c8-f6c9cc5a9082", + "path": "/downArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "8b7b4b16-64d7-4684-b765-dd373f3db36b", + "path": "/a", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "effe73ca-42ca-4ef9-b332-46033721db19", + "path": "/leftArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "a6106718-034d-44ea-b6c8-16e27484ec03", + "path": "/d", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "629d3b58-a5ea-4af0-baf9-7789482e53eb", + "path": "/rightArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "86e8892e-424e-4da9-864d-ffb06448f426", + "path": "/{Primary2DAxis}", + "interactions": "", + "processors": "", + "groups": "XR;All", + "action": "Move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "d8d7a2e7-3efb-483e-9824-c8496187f19c", + "path": "/stick", + "interactions": "", + "processors": "", + "groups": "Joystick;All", + "action": "Move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "c85b6852-da9e-4e42-8dc9-9b7132755518", + "path": "/rightStick", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Look", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "7ceac3f0-d22d-4650-8713-98e2a9035d44", + "path": "/delta", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse;Touch", + "action": "Look", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "e7648906-0e22-485d-9873-a72aec3bd015", + "path": "/{Hatswitch}", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Look", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "1b76c4ae-fd90-4c59-930d-5e129235588d", + "path": "/buttonWest", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "5929a281-4143-4290-86aa-4bb3ad4525b3", + "path": "/leftButton", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "8be4847d-7e0b-45b6-bcca-a73b370655e3", + "path": "/primaryTouch/tap", + "interactions": "", + "processors": "", + "groups": ";Touch", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "440784be-ff21-463a-9866-4b262e577dee", + "path": "/trigger", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "3cd27db6-663e-4cc4-8a82-a1140c402a1c", + "path": "/{PrimaryAction}", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "1d064e1e-99d3-4a76-8085-f52793ce4391", + "path": "/enter", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Attack", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "e3fa0b41-17a1-4fba-bf5c-0e5d784574f6", + "path": "/2", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Next", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "efab9770-1274-41a7-abac-dd8c7a30715b", + "path": "/dpad/right", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Next", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "411d2f6b-3ea0-4494-9a12-b09c26b0f476", + "path": "/leftShift", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Sprint", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "00e19607-f01e-4554-8d4c-48286554739a", + "path": "/leftStickPress", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Sprint", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "d805de75-193c-4309-82cd-0551e017cc1a", + "path": "/trigger", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Sprint", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "ed2432a4-2f77-432f-9139-7342d112b129", + "path": "/space", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Jump", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "961d648f-d94a-4355-b434-11922696108f", + "path": "/buttonSouth", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Jump", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "97dcbb91-1cbb-4093-8216-24449eb2791b", + "path": "/secondaryButton", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Jump", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "c80a7c4a-2d2c-4274-872a-62ce8fcdbfd3", + "path": "/1", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Previous", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "13e6a93b-b479-4ce5-907d-1fec410de53b", + "path": "/dpad/left", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Previous", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "b0ad6d55-d843-457a-901d-46f928cb0c26", + "path": "/e", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Interact", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "093d59a4-3bce-4e41-a215-b5a0e567b01a", + "path": "/buttonNorth", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Interact", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "637758ea-f982-4060-b06a-0f0c7c8d8ad3", + "path": "/buttonEast", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Crouch", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "19dcc6ab-1a7e-447d-a9f9-3325e00d715c", + "path": "/c", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Crouch", + "isComposite": false, + "isPartOfComposite": false + } + ] + }, + { + "name": "UI", + "id": "b078530f-faa4-449d-adc7-f09369ff9708", + "actions": [ + { + "name": "Navigate", + "type": "PassThrough", + "id": "2fc2ad40-3973-442d-8e65-89bcbcd13cb3", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Submit", + "type": "Button", + "id": "3cc811da-27c3-4bbc-889e-0ef1f2a2f492", + "expectedControlType": "", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Cancel", + "type": "Button", + "id": "e2c896b5-195d-48b9-a9aa-db74a36484db", + "expectedControlType": "", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "Point", + "type": "PassThrough", + "id": "b360b519-650c-4236-891e-cfe136d16357", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "Click", + "type": "PassThrough", + "id": "f0f2e40f-40f3-4159-af9c-2a3fe7c1eb97", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "RightClick", + "type": "PassThrough", + "id": "e128bdd7-e9cf-47c1-9144-4f67f73dcdb6", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "MiddleClick", + "type": "PassThrough", + "id": "5a926f79-155b-4338-b5aa-fa9a3f3aed05", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "ScrollWheel", + "type": "PassThrough", + "id": "06c553e3-6557-48be-a2a9-0f5b0175ddee", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "TrackedDevicePosition", + "type": "PassThrough", + "id": "64b04542-aa38-4080-9d28-b306af1b0fb4", + "expectedControlType": "Vector3", + "processors": "", + "interactions": "", + "initialStateCheck": false + }, + { + "name": "TrackedDeviceOrientation", + "type": "PassThrough", + "id": "f96a5843-b937-439e-9e6b-4cd978ecd871", + "expectedControlType": "Quaternion", + "processors": "", + "interactions": "", + "initialStateCheck": false + } + ], + "bindings": [ + { + "name": "Gamepad", + "id": "e054a09e-24f5-4e50-b660-97af056d5855", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "56c9af2b-11d6-4180-a3c8-3efd8c0eca10", + "path": "/leftStick/up", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "06306b52-7d98-4bb2-86a4-3e2527677ecb", + "path": "/rightStick/up", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "3b4458ed-f6d6-4deb-996f-9c724bae57c0", + "path": "/leftStick/down", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "c76ae3c2-1d0d-4149-be3b-137540eacb8f", + "path": "/rightStick/down", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "bb5decf2-953d-4522-a869-54296e6753ea", + "path": "/leftStick/left", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "96a0d137-ff3d-4963-b25b-e0c6f05beafb", + "path": "/rightStick/left", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "452f9adb-827c-440b-b53b-dc92977468e3", + "path": "/leftStick/right", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "89add4d1-e424-4815-9527-afc073b35b35", + "path": "/rightStick/right", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "9207470b-036c-449d-a48f-3bd265be3752", + "path": "/dpad", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "Joystick", + "id": "f3ffed66-d8a4-40bf-86c5-1bc6f74067a3", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "1e05bd28-8b67-4297-afc8-9c70c4b24acc", + "path": "/stick/up", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "c2f41ef9-9995-4e35-a849-8096b64b7057", + "path": "/stick/down", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "1329bbc2-fd9a-427c-8b42-b9a901cca776", + "path": "/stick/left", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "8c932013-a7e3-4b3a-a74e-58244d62f4b3", + "path": "/stick/right", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "Keyboard", + "id": "aee67287-82f5-4880-8bee-34d87d80e27e", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Navigate", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "c4009a36-4a5e-42eb-8e93-215e5cfebcc7", + "path": "/w", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "1a38639e-6b49-40f0-98f5-5a591f4583ac", + "path": "/upArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "097204c3-b95d-47ef-9053-0fbf07d2b767", + "path": "/s", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "eaa42b6b-3b54-4663-bd80-e86fccbf0908", + "path": "/downArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "374862dc-0a59-4ba5-b9d2-e7379383ca04", + "path": "/a", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "d83646dd-2ab4-4bdb-b497-fa01cba17e4b", + "path": "/leftArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "32b0f72c-dc8f-4047-b00d-84e314cc33c1", + "path": "/d", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "6ab3b966-70bf-4724-9abf-e80418e500f0", + "path": "/rightArrow", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Navigate", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "20a5a774-bb54-4d1c-9f88-101ef11ab6ba", + "path": "*/{Submit}", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse;Gamepad;Touch;Joystick;XR", + "action": "Submit", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "c2502c3e-33ff-4306-8ee0-67321c4b48e9", + "path": "*/{Cancel}", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse;Gamepad;Touch;Joystick;XR", + "action": "Cancel", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "f5b877ec-d80b-4f21-a76c-188f5f21b426", + "path": "/position", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Point", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "cb88e2e8-e45a-4162-a04c-f5e222d0ca09", + "path": "/position", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "Point", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "c2ed42be-b26a-4b30-9548-5995312e6027", + "path": "/touch*/position", + "interactions": "", + "processors": "", + "groups": "Touch", + "action": "Point", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "9417ec75-7652-46b5-9ad6-c158545a480f", + "path": "/leftButton", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "ec941567-2fdb-412d-a8da-1c5571f88754", + "path": "/tip", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "ce959143-b843-4122-a82f-79fe27044e74", + "path": "/touch*/press", + "interactions": "", + "processors": "", + "groups": "Touch", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "cfeb81b7-5e79-480b-8ebf-db7ff6f11384", + "path": "/trigger", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "Click", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "5c81c597-70c4-4ae8-8656-55a49a65e04e", + "path": "/scroll", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "ScrollWheel", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "bef090d3-f9d2-4050-a004-b7f16a9e00ce", + "path": "/rightButton", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "RightClick", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "850fc93c-6d06-4467-a406-09231958d851", + "path": "/middleButton", + "interactions": "", + "processors": "", + "groups": "Keyboard&Mouse", + "action": "MiddleClick", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "0eab82c1-ea93-4a34-9677-d13f9c717202", + "path": "/devicePosition", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "TrackedDevicePosition", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "cd8f5ca0-aa01-4fa2-8b60-30635900cc68", + "path": "/deviceRotation", + "interactions": "", + "processors": "", + "groups": "XR", + "action": "TrackedDeviceOrientation", + "isComposite": false, + "isPartOfComposite": false + } + ] + }, + { + "name": "Develop", + "id": "329ad99c-9b81-449f-88c0-15d64101c864", + "actions": [ + { + "name": "Tilda", + "type": "Button", + "id": "8f5f5dcc-36f8-43c8-9574-0a3592da0c6a", + "expectedControlType": "", + "processors": "", + "interactions": "", + "initialStateCheck": false + } + ], + "bindings": [ + { + "name": "", + "id": "0cc22a3b-89bc-4af9-b636-818cc91deba0", + "path": "/backquote", + "interactions": "", + "processors": "", + "groups": "", + "action": "Tilda", + "isComposite": false, + "isPartOfComposite": false + } + ] + } + ], + "controlSchemes": [ + { + "name": "All", + "bindingGroup": "All", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + }, + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + } + ] +} \ No newline at end of file diff --git a/Assets/_Project/Settings/Input/UserInputAction.inputactions.meta b/Assets/_Project/Settings/Input/UserInputAction.inputactions.meta new file mode 100644 index 0000000..a41250a --- /dev/null +++ b/Assets/_Project/Settings/Input/UserInputAction.inputactions.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: cf8ca7caa26651148b675eed74cbe3eb +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3} + generateWrapperCode: 1 + wrapperCodePath: + wrapperClassName: + wrapperCodeNamespace: diff --git a/Packages/manifest.json b/Packages/manifest.json index 35f6de3..9b7025f 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -6,6 +6,7 @@ "com.unity.ide.rider": "3.0.27", "com.unity.ide.visualstudio": "2.0.22", "com.unity.ide.vscode": "1.2.5", + "com.unity.inputsystem": "1.7.0", "com.unity.render-pipelines.universal": "14.0.9", "com.unity.test-framework": "1.1.33", "com.unity.textmeshpro": "3.0.6", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 337edac..48a4981 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -61,6 +61,15 @@ "dependencies": {}, "url": "https://packages.unity.com" }, + "com.unity.inputsystem": { + "version": "1.7.0", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.uielements": "1.0.0" + }, + "url": "https://packages.unity.com" + }, "com.unity.mathematics": { "version": "1.2.6", "depth": 1, diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 6027df3..543c602 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -925,7 +925,7 @@ PlayerSettings: hmiLogStartupTiming: 0 hmiCpuConfiguration: apiCompatibilityLevel: 6 - activeInputHandler: 0 + activeInputHandler: 2 windowsGamepadBackendHint: 0 cloudProjectId: 4a15d730-99ee-4a69-b00c-c0c75aa639bd framebufferDepthMemorylessMode: 0