Merge branch 'krazerleo/core/1' of https://gitea.gavt45.ru/gav/real-shooter into enikeev/dev/2

This commit is contained in:
Enikeevtimur
2022-05-10 00:34:08 +07:00
77 changed files with 37745 additions and 4651 deletions

View File

@ -1,4 +1,4 @@
using System;
using System;
using UnityEditor;
using UnityEngine;
using UnityEngine.InputSystem;
@ -7,7 +7,7 @@ using static scr_Models;
public class scr_WeaponController : MonoBehaviour
{
private scr_CharacterController characterController;
[Header("Settings")]
[Header("Settings")]
public WeaponSettingsModel settings;
[Header("References")]
@ -52,9 +52,9 @@ public class scr_WeaponController : MonoBehaviour
weaponAnimator.speed = characterController.weaponAnimationSpeed;
targetWeaponRotation.y += settings.SwayAmount * (settings.SwayXInverted ? -characterController.input_View.x : characterController.input_View.x) * Time.deltaTime;
targetWeaponRotation.x += settings.SwayAmount * (settings.SwayYInverted ? characterController.input_View.y : -characterController.input_View.y) * Time.deltaTime;
targetWeaponRotation.x += settings.SwayAmount * (settings.SwayYInverted ? characterController.input_View.y : -characterController.input_View.y) * Time.deltaTime;
//newWeaponRotation.x = Mathf.Clamp(newWeaponRotation.x, ViewClampYMin, ViewClampYMax);
targetWeaponRotation.x = Mathf.Clamp(targetWeaponRotation.x, -settings.SwayClampX, settings.SwayClampX);
targetWeaponRotation.y = Mathf.Clamp(targetWeaponRotation.y, -settings.SwayClampY, settings.SwayClampY);
@ -77,4 +77,4 @@ public class scr_WeaponController : MonoBehaviour
{
weaponAnimator.SetBool("isSprinting", characterController.isSprinting);
}
}
}