wip: add aim

This commit is contained in:
2022-04-17 14:03:57 +07:00
parent 60e8cc14fd
commit 2fd9694679
7 changed files with 391 additions and 2800 deletions

View File

@ -1,29 +1,31 @@
using System;
using UnityEditor;
using UnityEngine;
using UnityEngine.InputSystem;
using static scr_Models;
public class scr_WeaponController : MonoBehaviour
{
private scr_CharacterController characterController;
[Header("Settings")]
[Header("Settings")]
public WeaponSettingsModel settings;
[Header("References")]
public Animator weaponAnimator;
private bool isInitialised;
Vector3 newWeaponRotation;
Vector3 newWeaponRotationVelocity;
Vector3 targetWeaponRotation;
Vector3 targetWeaponRotationVelocity;
Vector3 newWeaponMovementRotation;
Vector3 newWeaponRotationMovementVelocity;
Vector3 targetWeaponMovementRotation;
Vector3 targetWeaponMovementRotationVelocity;
private void Start()
{
newWeaponRotation = transform.localRotation.eulerAngles;
@ -45,7 +47,6 @@ public class scr_WeaponController : MonoBehaviour
CalculateWeaponRotation();
SetWeaponAnimation();
}
private void CalculateWeaponRotation()
{
weaponAnimator.speed = characterController.weaponAnimationSpeed;