As before

This commit is contained in:
Programmer-DField 2021-03-01 18:03:57 +00:00
parent 169c2a4477
commit 40075087aa
4 changed files with 1523 additions and 488 deletions

View File

@ -0,0 +1,33 @@
using System.Collections;
using System.Collections.Generic;
using Cinemachine;
using UnityEngine;
using UnityEngine.InputSystem;
[RequireComponent(typeof(CinemachineFreeLook))]
public class FreeLookAddOn : MonoBehaviour
{
[Range(0f, 10f)] public float LookSpeed = 1f;
public bool InvertY = false;
private CinemachineFreeLook _freeLookComponent;
public void Start()
{
_freeLookComponent = GetComponent<CinemachineFreeLook>();
}
// Update the look movement each time the event is trigger
public void OnLook(InputAction.CallbackContext context)
{
//Normalize the vector to have an uniform vector in whichever form it came from (I.E Gamepad, mouse, etc)
Vector2 lookMovement = context.ReadValue<Vector2>().normalized;
lookMovement.y = InvertY ? -lookMovement.y : lookMovement.y;
// This is because X axis is only contains between -180 and 180 instead of 0 and 1 like the Y axis
lookMovement.x = lookMovement.x * 180f;
//Ajust axis values using look speed and Time.deltaTime so the look doesn't go faster if there is more FPS
_freeLookComponent.m_XAxis.Value += lookMovement.x * LookSpeed * Time.deltaTime;
_freeLookComponent.m_YAxis.Value += lookMovement.y * LookSpeed * Time.deltaTime;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4e2b06b1980697747a979f7637a7276c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -1,487 +1,487 @@
%YAML 1.1 %YAML 1.1
%TAG !u! tag:unity3d.com,2011: %TAG !u! tag:unity3d.com,2011:
--- !u!13 &1 --- !u!13 &1
InputManager: InputManager:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
serializedVersion: 2 serializedVersion: 2
m_Axes: m_Axes:
- serializedVersion: 3 - serializedVersion: 3
m_Name: Horizontal m_Name: Horizontal
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: left negativeButton: left
positiveButton: right positiveButton: right
altNegativeButton: a altNegativeButton: a
altPositiveButton: d altPositiveButton: d
gravity: 3 gravity: 3
dead: 0.001 dead: 0.001
sensitivity: 3 sensitivity: 3
snap: 1 snap: 1
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Vertical m_Name: Vertical
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: down negativeButton: down
positiveButton: up positiveButton: up
altNegativeButton: s altNegativeButton: s
altPositiveButton: w altPositiveButton: w
gravity: 3 gravity: 3
dead: 0.001 dead: 0.001
sensitivity: 3 sensitivity: 3
snap: 1 snap: 1
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Fire1 m_Name: Fire1
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: left ctrl positiveButton: left ctrl
altNegativeButton: altNegativeButton:
altPositiveButton: mouse 0 altPositiveButton: mouse 0
gravity: 1000 gravity: 1000
dead: 0.001 dead: 0.001
sensitivity: 1000 sensitivity: 1000
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Fire2 m_Name: Fire2
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: left alt positiveButton: left alt
altNegativeButton: altNegativeButton:
altPositiveButton: mouse 1 altPositiveButton: mouse 1
gravity: 1000 gravity: 1000
dead: 0.001 dead: 0.001
sensitivity: 1000 sensitivity: 1000
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Fire3 m_Name: Fire3
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: left shift positiveButton: left shift
altNegativeButton: altNegativeButton:
altPositiveButton: mouse 2 altPositiveButton: mouse 2
gravity: 1000 gravity: 1000
dead: 0.001 dead: 0.001
sensitivity: 1000 sensitivity: 1000
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Jump m_Name: Jump
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: space positiveButton: space
altNegativeButton: altNegativeButton:
altPositiveButton: altPositiveButton:
gravity: 1000 gravity: 1000
dead: 0.001 dead: 0.001
sensitivity: 1000 sensitivity: 1000
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Mouse X m_Name: Mouse X
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: positiveButton:
altNegativeButton: altNegativeButton:
altPositiveButton: altPositiveButton:
gravity: 0 gravity: 0
dead: 0 dead: 0
sensitivity: 0.1 sensitivity: 0.1
snap: 0 snap: 0
invert: 0 invert: 0
type: 1 type: 1
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Mouse Y m_Name: Mouse Y
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: positiveButton:
altNegativeButton: altNegativeButton:
altPositiveButton: altPositiveButton:
gravity: 0 gravity: 0
dead: 0 dead: 0
sensitivity: 0.1 sensitivity: 0.1
snap: 0 snap: 0
invert: 0 invert: 0
type: 1 type: 1
axis: 1 axis: 1
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Mouse ScrollWheel m_Name: Mouse ScrollWheel
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: positiveButton:
altNegativeButton: altNegativeButton:
altPositiveButton: altPositiveButton:
gravity: 0 gravity: 0
dead: 0 dead: 0
sensitivity: 0.1 sensitivity: 0.1
snap: 0 snap: 0
invert: 0 invert: 0
type: 1 type: 1
axis: 2 axis: 2
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Horizontal m_Name: Horizontal
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: positiveButton:
altNegativeButton: altNegativeButton:
altPositiveButton: altPositiveButton:
gravity: 0 gravity: 0
dead: 0.19 dead: 0.19
sensitivity: 1 sensitivity: 1
snap: 0 snap: 0
invert: 0 invert: 0
type: 2 type: 2
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Vertical m_Name: Vertical
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: positiveButton:
altNegativeButton: altNegativeButton:
altPositiveButton: altPositiveButton:
gravity: 0 gravity: 0
dead: 0.19 dead: 0.19
sensitivity: 1 sensitivity: 1
snap: 0 snap: 0
invert: 1 invert: 1
type: 2 type: 2
axis: 1 axis: 1
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Fire1 m_Name: Fire1
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: joystick button 0 positiveButton: joystick button 0
altNegativeButton: altNegativeButton:
altPositiveButton: altPositiveButton:
gravity: 1000 gravity: 1000
dead: 0.001 dead: 0.001
sensitivity: 1000 sensitivity: 1000
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Fire2 m_Name: Fire2
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: joystick button 1 positiveButton: joystick button 1
altNegativeButton: altNegativeButton:
altPositiveButton: altPositiveButton:
gravity: 1000 gravity: 1000
dead: 0.001 dead: 0.001
sensitivity: 1000 sensitivity: 1000
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Fire3 m_Name: Fire3
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: joystick button 2 positiveButton: joystick button 2
altNegativeButton: altNegativeButton:
altPositiveButton: altPositiveButton:
gravity: 1000 gravity: 1000
dead: 0.001 dead: 0.001
sensitivity: 1000 sensitivity: 1000
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Jump m_Name: Jump
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: joystick button 3 positiveButton: joystick button 3
altNegativeButton: altNegativeButton:
altPositiveButton: altPositiveButton:
gravity: 1000 gravity: 1000
dead: 0.001 dead: 0.001
sensitivity: 1000 sensitivity: 1000
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Submit m_Name: Submit
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: return positiveButton: return
altNegativeButton: altNegativeButton:
altPositiveButton: joystick button 0 altPositiveButton: joystick button 0
gravity: 1000 gravity: 1000
dead: 0.001 dead: 0.001
sensitivity: 1000 sensitivity: 1000
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Submit m_Name: Submit
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: enter positiveButton: enter
altNegativeButton: altNegativeButton:
altPositiveButton: space altPositiveButton: space
gravity: 1000 gravity: 1000
dead: 0.001 dead: 0.001
sensitivity: 1000 sensitivity: 1000
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Cancel m_Name: Cancel
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: escape positiveButton: escape
altNegativeButton: altNegativeButton:
altPositiveButton: joystick button 1 altPositiveButton: joystick button 1
gravity: 1000 gravity: 1000
dead: 0.001 dead: 0.001
sensitivity: 1000 sensitivity: 1000
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Enable Debug Button 1 m_Name: Enable Debug Button 1
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: left ctrl positiveButton: left ctrl
altNegativeButton: altNegativeButton:
altPositiveButton: joystick button 8 altPositiveButton: joystick button 8
gravity: 0 gravity: 0
dead: 0 dead: 0
sensitivity: 0 sensitivity: 0
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Enable Debug Button 2 m_Name: Enable Debug Button 2
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: backspace positiveButton: backspace
altNegativeButton: altNegativeButton:
altPositiveButton: joystick button 9 altPositiveButton: joystick button 9
gravity: 0 gravity: 0
dead: 0 dead: 0
sensitivity: 0 sensitivity: 0
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Debug Reset m_Name: Debug Reset
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: left alt positiveButton: left alt
altNegativeButton: altNegativeButton:
altPositiveButton: joystick button 1 altPositiveButton: joystick button 1
gravity: 0 gravity: 0
dead: 0 dead: 0
sensitivity: 0 sensitivity: 0
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Debug Next m_Name: Debug Next
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: page down positiveButton: page down
altNegativeButton: altNegativeButton:
altPositiveButton: joystick button 5 altPositiveButton: joystick button 5
gravity: 0 gravity: 0
dead: 0 dead: 0
sensitivity: 0 sensitivity: 0
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Debug Previous m_Name: Debug Previous
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: page up positiveButton: page up
altNegativeButton: altNegativeButton:
altPositiveButton: joystick button 4 altPositiveButton: joystick button 4
gravity: 0 gravity: 0
dead: 0 dead: 0
sensitivity: 0 sensitivity: 0
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Debug Validate m_Name: Debug Validate
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: return positiveButton: return
altNegativeButton: altNegativeButton:
altPositiveButton: joystick button 0 altPositiveButton: joystick button 0
gravity: 0 gravity: 0
dead: 0 dead: 0
sensitivity: 0 sensitivity: 0
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Debug Persistent m_Name: Debug Persistent
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: right shift positiveButton: right shift
altNegativeButton: altNegativeButton:
altPositiveButton: joystick button 2 altPositiveButton: joystick button 2
gravity: 0 gravity: 0
dead: 0 dead: 0
sensitivity: 0 sensitivity: 0
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Debug Multiplier m_Name: Debug Multiplier
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: negativeButton:
positiveButton: left shift positiveButton: left shift
altNegativeButton: altNegativeButton:
altPositiveButton: joystick button 3 altPositiveButton: joystick button 3
gravity: 0 gravity: 0
dead: 0 dead: 0
sensitivity: 0 sensitivity: 0
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Debug Horizontal m_Name: Debug Horizontal
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: left negativeButton: left
positiveButton: right positiveButton: right
altNegativeButton: altNegativeButton:
altPositiveButton: altPositiveButton:
gravity: 1000 gravity: 1000
dead: 0.001 dead: 0.001
sensitivity: 1000 sensitivity: 1000
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Debug Vertical m_Name: Debug Vertical
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: down negativeButton: down
positiveButton: up positiveButton: up
altNegativeButton: altNegativeButton:
altPositiveButton: altPositiveButton:
gravity: 1000 gravity: 1000
dead: 0.001 dead: 0.001
sensitivity: 1000 sensitivity: 1000
snap: 0 snap: 0
invert: 0 invert: 0
type: 0 type: 0
axis: 0 axis: 0
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Debug Vertical m_Name: Debug Vertical
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: down negativeButton: down
positiveButton: up positiveButton: up
altNegativeButton: altNegativeButton:
altPositiveButton: altPositiveButton:
gravity: 1000 gravity: 1000
dead: 0.001 dead: 0.001
sensitivity: 1000 sensitivity: 1000
snap: 0 snap: 0
invert: 0 invert: 0
type: 2 type: 2
axis: 6 axis: 6
joyNum: 0 joyNum: 0
- serializedVersion: 3 - serializedVersion: 3
m_Name: Debug Horizontal m_Name: Debug Horizontal
descriptiveName: descriptiveName:
descriptiveNegativeName: descriptiveNegativeName:
negativeButton: left negativeButton: left
positiveButton: right positiveButton: right
altNegativeButton: altNegativeButton:
altPositiveButton: altPositiveButton:
gravity: 1000 gravity: 1000
dead: 0.001 dead: 0.001
sensitivity: 1000 sensitivity: 1000
snap: 0 snap: 0
invert: 0 invert: 0
type: 2 type: 2
axis: 5 axis: 5
joyNum: 0 joyNum: 0