added endscreen

This commit is contained in:
MrTorex committed 2026-02-24 10:33:33 +03:00
1 parent a33eb50ca0
commit 2b01c50795
15 files changed
+989 -88

No files matched your search

@@ -10,6 +10,5 @@ namespace Code.Gameplay.Character.Core
public Vector3 CameraPlanarDirection;
public bool JumpPressed;
public bool SprintPressed;
public bool SlidePressed;
}
}
@@ -18,25 +18,12 @@ namespace Code.Gameplay.Character.Core
private IInputService _inputService;
private CameraController _cameraController;
public CustomCharacterController CustomCharacterController => customCharacterController;
public HealthSystem HealthSystem => healthSystem;
public WeaponInventory WeaponInventory => weaponInventory;
public Transform GetFollowTransform() => cameraFollowPoint;
private void Start()
{
_inputService = FindFirstObjectByType<DIContainer>()?.Resolve<IInputService>();
_cameraController = FindFirstObjectByType<CameraController>();
if (_inputService == null)
{
Debug.LogError("IInputService not found!");
}
if (_cameraController == null)
{
Debug.LogError("CameraController not found!");
}
if (healthSystem != null)
{
@@ -55,15 +42,6 @@ namespace Code.Gameplay.Character.Core
Debug.Log("Character died!");
}
public void Teleport(Vector3 position, Quaternion rotation)
{
if (customCharacterController != null)
{
customCharacterController.SetPosition(position);
customCharacterController.SetRotation(rotation);
}
}
private void HandleCharacterInput()
{
if (_inputService == null || _cameraController == null || customCharacterController == null)
@@ -24,10 +24,7 @@ namespace Code.Gameplay.Character.Controller
private float _jumpCooldownTimer;
private float JumpCooldownDuration => jumpCooldownDuration;
public bool CanJump => _jumpCooldownTimer <= 0f;
public void SetPosition(Vector3 position) => motor.SetPosition(position);
public void SetRotation(Quaternion rotation) => motor.SetRotation(rotation);
private void Start()
{
_inputHandler = new CharacterInputHandler(
@@ -7,10 +7,10 @@ namespace Code.Gameplay.Character.Inventory
{
public class WeaponInventory : MonoBehaviour
{
[SerializeField] private List<WeaponBase> weapons = new List<WeaponBase>();
[SerializeField] private List<WeaponBase> weapons = new();
[SerializeField] private Transform weaponHolder;
[SerializeField] private int currentWeaponIndex = 0;
[SerializeField] private int currentWeaponIndex;
public event Action<WeaponBase> OnWeaponSwitched;
public event Action OnWeaponsInitialized;
@@ -54,13 +54,13 @@ namespace Code.Gameplay.Character.Inventory
public void NextWeapon()
{
int nextIndex = (currentWeaponIndex + 1) % weapons.Count;
var nextIndex = (currentWeaponIndex + 1) % weapons.Count;
SwitchWeapon(nextIndex);
}
public void PreviousWeapon()
{
int prevIndex = (currentWeaponIndex - 1 + weapons.Count) % weapons.Count;
var prevIndex = (currentWeaponIndex - 1 + weapons.Count) % weapons.Count;
SwitchWeapon(prevIndex);
}
@@ -68,7 +68,7 @@ namespace Code.Gameplay.Character.Inventory
{
if (weapons.Contains(weapon))
{
int index = weapons.IndexOf(weapon);
var index = weapons.IndexOf(weapon);
weapons.Remove(weapon);
Destroy(weapon.gameObject);