Merge branch 'fix/camera' into 'main'

Fix/camera

Closes #128

See merge request kernel-panic/revival!66
This commit is contained in:
Cinder Foster-Smith 2021-04-16 10:36:03 +00:00
commit f228c1a8ea
6 changed files with 279 additions and 21 deletions

View File

@ -610,6 +610,7 @@ GameObject:
- component: {fileID: 5661344207789115423} - component: {fileID: 5661344207789115423}
- component: {fileID: 7951179702612018041} - component: {fileID: 7951179702612018041}
- component: {fileID: 4646968772435671935} - component: {fileID: 4646968772435671935}
- component: {fileID: 6450882301115788249}
m_Layer: 0 m_Layer: 0
m_Name: CM_ThirdPerson m_Name: CM_ThirdPerson
m_TagString: Untagged m_TagString: Untagged
@ -718,7 +719,7 @@ MonoBehaviour:
m_RecenterToTargetHeading: m_RecenterToTargetHeading:
m_enabled: 0 m_enabled: 0
m_WaitTime: 1 m_WaitTime: 1
m_RecenteringTime: 2 m_RecenteringTime: 1.1
m_LegacyHeadingDefinition: -1 m_LegacyHeadingDefinition: -1
m_LegacyVelocityFilterStrength: -1 m_LegacyVelocityFilterStrength: -1
m_BindingMode: 4 m_BindingMode: 4
@ -727,9 +728,9 @@ MonoBehaviour:
- m_Height: 2 - m_Height: 2
m_Radius: 2 m_Radius: 2
- m_Height: 1 - m_Height: 1
m_Radius: 1.5 m_Radius: 2
- m_Height: 0 - m_Height: 0
m_Radius: 1.5 m_Radius: 2
m_LegacyHeadingBias: 3.4028235e+38 m_LegacyHeadingBias: 3.4028235e+38
m_Rigs: m_Rigs:
- {fileID: 5661344207439169722} - {fileID: 5661344207439169722}
@ -836,6 +837,21 @@ MonoBehaviour:
m_StringArgument: m_StringArgument:
m_BoolArgument: 0 m_BoolArgument: 0
m_CallState: 2 m_CallState: 2
--- !u!114 &6450882301115788249
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5661344207789115490}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c825c87a182e76448880f374c3ef9b73, type: 3}
m_Name:
m_EditorClassIdentifier:
_axisDifference: 0.3
_inputMagnitude: 0.1
_moveInput: {fileID: -470994912084233759, guid: d4d9eb5db7beac84ca3cb36cfc09cd0a, type: 3}
--- !u!1 &5661344207849762654 --- !u!1 &5661344207849762654
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -607,7 +607,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1703779518772407877} m_GameObject: {fileID: 1703779518772407877}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.036, y: 1.403, z: -0.093} m_LocalPosition: {x: 0, y: 1.403, z: 0}
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_Children: [] m_Children: []
m_Father: {fileID: 13726837642651460} m_Father: {fileID: 13726837642651460}

View File

@ -206,15 +206,11 @@ PrefabInstance:
- target: {fileID: 5661344207789115489, guid: dfbecbd9a563dba43be2d6139d9b3f90, type: 3} - target: {fileID: 5661344207789115489, guid: dfbecbd9a563dba43be2d6139d9b3f90, type: 3}
propertyPath: m_Follow propertyPath: m_Follow
value: value:
objectReference: {fileID: 4676633831945762709} objectReference: {fileID: 3150647428828152554}
- target: {fileID: 5661344207789115489, guid: dfbecbd9a563dba43be2d6139d9b3f90, type: 3} - target: {fileID: 5661344207789115489, guid: dfbecbd9a563dba43be2d6139d9b3f90, type: 3}
propertyPath: m_LookAt propertyPath: m_LookAt
value: value:
objectReference: {fileID: 3150647428828152554} objectReference: {fileID: 3150647428828152554}
- target: {fileID: 5661344207789115489, guid: dfbecbd9a563dba43be2d6139d9b3f90, type: 3}
propertyPath: m_XAxis.Value
value: -89.63728
objectReference: {fileID: 0}
- target: {fileID: 5661344207849762652, guid: dfbecbd9a563dba43be2d6139d9b3f90, type: 3} - target: {fileID: 5661344207849762652, guid: dfbecbd9a563dba43be2d6139d9b3f90, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: 0 value: 0

View File

@ -2314,6 +2314,62 @@ PrefabInstance:
m_Modification: m_Modification:
m_TransformParent: {fileID: 0} m_TransformParent: {fileID: 0}
m_Modifications: m_Modifications:
- target: {fileID: 4676633831318799747, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4676633831318799747, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4676633831318799747, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4676633831318799747, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.w
value: 0.5675246
objectReference: {fileID: 0}
- target: {fileID: 4676633831318799747, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.x
value: 0.06285195
objectReference: {fileID: 0}
- target: {fileID: 4676633831318799747, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.y
value: 0.7702346
objectReference: {fileID: 0}
- target: {fileID: 4676633831318799747, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.z
value: -0.28408486
objectReference: {fileID: 0}
- target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.y
value: 0.25224686
objectReference: {fileID: 0}
- target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.z
value: -2.720001
objectReference: {fileID: 0}
- target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.w
value: 0.97241694
objectReference: {fileID: 0}
- target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.x
value: 0.22955646
objectReference: {fileID: 0}
- target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.y
value: 0.04023727
objectReference: {fileID: 0}
- target: {fileID: 4676633831388223341, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.z
value: -0.009498729
objectReference: {fileID: 0}
- target: {fileID: 4676633831414007564, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} - target: {fileID: 4676633831414007564, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: PlayerObjects value: PlayerObjects
@ -2362,6 +2418,154 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4676633832548214813, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_BindingMode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4676633832548214813, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_XAxis.Value
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4676633832548214813, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_Heading.m_Definition
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4676633832548214813, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_Heading.m_VelocityFilterStrength
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4676633832617577688, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_BiasY
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4676633832617577688, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_SoftZoneHeight
value: 0.55
objectReference: {fileID: 0}
- target: {fileID: 4676633832617577689, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_BindingMode
value: 4
objectReference: {fileID: 0}
- target: {fileID: 4676633832617577689, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_XAxis.Value
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4676633832617577689, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_Heading.m_Definition
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4676633832617577689, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_Heading.m_VelocityFilterStrength
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.x
value: -0.00234609
objectReference: {fileID: 0}
- target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.y
value: -0.1613084
objectReference: {fileID: 0}
- target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.z
value: 0.04089399
objectReference: {fileID: 0}
- target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.w
value: 0.56935894
objectReference: {fileID: 0}
- target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.x
value: 0.04318457
objectReference: {fileID: 0}
- target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.y
value: 0.7795997
objectReference: {fileID: 0}
- target: {fileID: 4676633832789495666, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.z
value: -0.25727367
objectReference: {fileID: 0}
- target: {fileID: 4676633832858914730, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_YAxis.m_SpeedMode
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4676633832858914730, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_YAxis.m_InvertInput
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4676633832858914730, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_Heading.m_VelocityFilterStrength
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4676633832858914731, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4676633832858914731, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.y
value: 0.25224686
objectReference: {fileID: 0}
- target: {fileID: 4676633832858914731, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.z
value: -2.720001
objectReference: {fileID: 0}
- target: {fileID: 4676633832858914773, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.w
value: 0.5333047
objectReference: {fileID: 0}
- target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.x
value: 0.059062168
objectReference: {fileID: 0}
- target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.y
value: 0.7917243
objectReference: {fileID: 0}
- target: {fileID: 4676633832928372887, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_LocalRotation.z
value: -0.29201084
objectReference: {fileID: 0}
- target: {fileID: 4676633833077728949, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_SoftZoneHeight
value: 0.48
objectReference: {fileID: 0}
- target: {fileID: 4676633833077728950, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_BindingMode
value: 4
objectReference: {fileID: 0}
- target: {fileID: 4676633833077728950, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_XAxis.Value
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4676633833077728950, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_FollowOffset.z
value: -2
objectReference: {fileID: 0}
- target: {fileID: 4676633833077728950, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_Heading.m_Definition
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4676633833077728950, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
propertyPath: m_Heading.m_VelocityFilterStrength
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 8a918f60d084fbe468bf3b2c0a14fb52, type: 3}
--- !u!4 &783507384 stripped --- !u!4 &783507384 stripped
@ -11685,7 +11889,7 @@ BoxCollider:
m_GameObject: {fileID: 1760111728} m_GameObject: {fileID: 1760111728}
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 0 m_IsTrigger: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 0.8177327, y: 2.9946482, z: 1.0689269} m_Size: {x: 0.8177327, y: 2.9946482, z: 1.0689269}
m_Center: {x: 0, y: 1.5181595, z: 0} m_Center: {x: 0, y: 1.5181595, z: 0}
@ -14427,7 +14631,7 @@ BoxCollider:
m_GameObject: {fileID: 349763870} m_GameObject: {fileID: 349763870}
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 0 m_IsTrigger: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 0.8177327, y: 2.9946482, z: 1.0689269} m_Size: {x: 0.8177327, y: 2.9946482, z: 1.0689269}
m_Center: {x: 0, y: 1.5181595, z: 0} m_Center: {x: 0, y: 1.5181595, z: 0}
@ -14943,7 +15147,7 @@ BoxCollider:
m_GameObject: {fileID: 1865590810} m_GameObject: {fileID: 1865590810}
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 0 m_IsTrigger: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 0.8177327, y: 2.9946482, z: 1.0689269} m_Size: {x: 0.8177327, y: 2.9946482, z: 1.0689269}
m_Center: {x: 0, y: 1.5181595, z: 0} m_Center: {x: 0, y: 1.5181595, z: 0}
@ -20472,7 +20676,7 @@ BoxCollider:
m_GameObject: {fileID: 80785596} m_GameObject: {fileID: 80785596}
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 0 m_IsTrigger: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 0.8177329, y: 2.9946482, z: 1.0689272} m_Size: {x: 0.8177329, y: 2.9946482, z: 1.0689272}
m_Center: {x: 0, y: 1.5181595, z: 0} m_Center: {x: 0, y: 1.5181595, z: 0}
@ -21724,7 +21928,7 @@ BoxCollider:
m_GameObject: {fileID: 1910170592} m_GameObject: {fileID: 1910170592}
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 0 m_IsTrigger: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 0.8177329, y: 2.9946482, z: 1.0689272} m_Size: {x: 0.8177329, y: 2.9946482, z: 1.0689272}
m_Center: {x: 0, y: 1.5181595, z: 0} m_Center: {x: 0, y: 1.5181595, z: 0}
@ -27365,7 +27569,7 @@ BoxCollider:
m_GameObject: {fileID: 1983942218} m_GameObject: {fileID: 1983942218}
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 0 m_IsTrigger: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 0.8177329, y: 2.9946482, z: 1.0689272} m_Size: {x: 0.8177329, y: 2.9946482, z: 1.0689272}
m_Center: {x: 0, y: 1.5181595, z: 0} m_Center: {x: 0, y: 1.5181595, z: 0}
@ -31939,7 +32143,7 @@ BoxCollider:
m_GameObject: {fileID: 1987160348} m_GameObject: {fileID: 1987160348}
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 0 m_IsTrigger: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 0.8177327, y: 2.9946482, z: 1.0689269} m_Size: {x: 0.8177327, y: 2.9946482, z: 1.0689269}
m_Center: {x: 0, y: 1.5181595, z: 0} m_Center: {x: 0, y: 1.5181595, z: 0}
@ -34413,7 +34617,7 @@ BoxCollider:
m_GameObject: {fileID: 830963316} m_GameObject: {fileID: 830963316}
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 0 m_IsTrigger: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 0.8177329, y: 2.9946482, z: 1.0689272} m_Size: {x: 0.8177329, y: 2.9946482, z: 1.0689272}
m_Center: {x: 0, y: 1.5181595, z: 0} m_Center: {x: 0, y: 1.5181595, z: 0}
@ -35315,7 +35519,7 @@ BoxCollider:
m_GameObject: {fileID: 370537927} m_GameObject: {fileID: 370537927}
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 0 m_IsTrigger: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 0.8177329, y: 2.9946482, z: 1.0689272} m_Size: {x: 0.8177329, y: 2.9946482, z: 1.0689272}
m_Center: {x: 0, y: 1.5181595, z: 0} m_Center: {x: 0, y: 1.5181595, z: 0}
@ -36265,7 +36469,7 @@ BoxCollider:
m_GameObject: {fileID: 1208898829} m_GameObject: {fileID: 1208898829}
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 0 m_IsTrigger: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 0.8177327, y: 2.9946482, z: 1.0689269} m_Size: {x: 0.8177327, y: 2.9946482, z: 1.0689269}
m_Center: {x: 0, y: 1.5181595, z: 0} m_Center: {x: 0, y: 1.5181595, z: 0}
@ -42027,7 +42231,7 @@ BoxCollider:
m_GameObject: {fileID: 1089051573} m_GameObject: {fileID: 1089051573}
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 0 m_IsTrigger: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 0.8177327, y: 2.9946482, z: 1.0689269} m_Size: {x: 0.8177327, y: 2.9946482, z: 1.0689269}
m_Center: {x: 0, y: 1.5181595, z: 0} m_Center: {x: 0, y: 1.5181595, z: 0}
@ -50302,7 +50506,7 @@ BoxCollider:
m_GameObject: {fileID: 158669707} m_GameObject: {fileID: 158669707}
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 0 m_IsTrigger: 0
m_Enabled: 1 m_Enabled: 0
serializedVersion: 2 serializedVersion: 2
m_Size: {x: 0.8177329, y: 2.9946482, z: 1.0689272} m_Size: {x: 0.8177329, y: 2.9946482, z: 1.0689272}
m_Center: {x: 0, y: 1.5181595, z: 0} m_Center: {x: 0, y: 1.5181595, z: 0}

View File

@ -0,0 +1,31 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Cinemachine;
using UnityEngine;
using UnityEngine.InputSystem;
[RequireComponent(typeof(CinemachineFreeLook))]
public class TargetRecentering : MonoBehaviour
{
[SerializeField] [Range(0, 1)] private float _inputMagnitude = 0.1f;
[SerializeField] private InputActionReference _moveInput;
private CinemachineFreeLook _freeLook;
private void Start()
{
_freeLook = GetComponent<CinemachineFreeLook>();
}
private void Update()
{
// if there is any horizontal movement input...
var input = _moveInput.action.ReadValue<Vector2>();
var result = Mathf.Abs(input.x) > Mathf.Abs(input.y) && input.magnitude > _inputMagnitude;
// ...enable target recentering in order to turn the camera with the player
_freeLook.m_RecenterToTargetHeading.m_enabled = result;
}
}

View File

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