Camera Shake, WeaponSwitch Animation

Added camera shake. Its not working.. i dont know why.
WeaponSwitch is also not working
This commit is contained in:
Noah4ever
2021-12-12 18:19:36 +01:00
parent 9512d9dac1
commit a2ac91bf6e
8 changed files with 731 additions and 73 deletions

View File

@@ -519,6 +519,7 @@ MonoBehaviour:
impulsForce: 0.01
maxRecoil: 0.1
playerAnimator: {fileID: 1978909962}
switchVal: 0
aimSpeed: 0.06
aimVal: 0
AimPoint: {fileID: 2992488853448454767}
@@ -571,6 +572,8 @@ MonoBehaviour:
username:
usernameTextObj: {fileID: 0}
health: 0
playerNeck: {fileID: 7061967201775281134}
playerCamera: {fileID: 6272346181657429395}
--- !u!114 &1258077278480047560
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -812,7 +815,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6272346181657429393}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0.15, z: 0}
m_LocalPosition: {x: 0, y: 0.14999998, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:

View File

@@ -766,10 +766,102 @@ PrefabInstance:
propertyPath: explodeParticle
value:
objectReference: {fileID: 842071826}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeRadius
value: 200
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: lengthOfExplosion
value: 0.1
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeDuration
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.size
value: 3
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].time
value: 0.004529953
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].time
value: 0.47748455
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].time
value: 3.651196
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].value
value: 0.008758545
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].value
value: 3.9823725
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].value
value: 1.3784328
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].inSlope
value: 8.401682
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].inSlope
value: -2.910338
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].inSlope
value: -0.82047147
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].inWeight
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].outSlope
value: 8.401682
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].inWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].outSlope
value: -2.910338
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].inWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].outSlope
value: -0.82047147
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].outWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].outWeight
value: 0.09326189
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].tangentMode
value: 34
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].tangentMode
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].tangentMode
value: 34
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
--- !u!1 &186344863
@@ -2336,6 +2428,243 @@ MeshFilter:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 771793552}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1001 &814323979
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_RootOrder
value: 11
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalScale.x
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalScale.y
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalScale.z
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalPosition.x
value: 4.213
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalPosition.y
value: 2.013
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalPosition.z
value: 2.961
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2236875552107647873, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_Layer
value: 7
objectReference: {fileID: 0}
- target: {fileID: 3709710254213546924, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_Layer
value: 7
objectReference: {fileID: 0}
- target: {fileID: 3884320679152247161, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_Layer
value: 7
objectReference: {fileID: 0}
- target: {fileID: 5071598280516985511, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_Name
value: Grenade (1)
objectReference: {fileID: 0}
- target: {fileID: 5071598280516985511, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_Layer
value: 7
objectReference: {fileID: 0}
- target: {fileID: 5204381087217674634, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: dropForce
value: 10
objectReference: {fileID: 0}
- target: {fileID: 5204381087217674634, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: grenadeRadius
value: 3
objectReference: {fileID: 0}
- target: {fileID: 5204381087217674634, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: hasBeenThrown
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5204381087217674634, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: explosionForce
value: 500
objectReference: {fileID: 0}
- target: {fileID: 5918420165866215312, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalPosition.x
value: -0.041
objectReference: {fileID: 0}
- target: {fileID: 5918420165866215312, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalPosition.y
value: 0.057
objectReference: {fileID: 0}
- target: {fileID: 5918420165866215312, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalPosition.z
value: -0.53
objectReference: {fileID: 0}
- target: {fileID: 5918420165866215314, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 7e832beb11d0b11499c8a1b3b4e52e78, type: 2}
- target: {fileID: 5918420165866215318, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_Layer
value: 7
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: grenadeRadius
value: 5
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: showExplosion
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: explosionForce
value: 600
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: explodeParticle
value:
objectReference: {fileID: 842071826}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeRadius
value: 200
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: lengthOfExplosion
value: 0.1
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeDuration
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.size
value: 3
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].time
value: 0.004529953
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].time
value: 0.47748455
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].time
value: 3.651196
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].value
value: 0.008758545
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].value
value: 3.9823725
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].value
value: 1.3784328
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].inSlope
value: 8.401682
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].inSlope
value: -2.910338
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].inSlope
value: -0.82047147
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].inWeight
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].outSlope
value: 8.401682
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].inWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].outSlope
value: -2.910338
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].inWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].outSlope
value: -0.82047147
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].outWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].outWeight
value: 0.09326189
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].tangentMode
value: 34
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].tangentMode
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].tangentMode
value: 34
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
--- !u!1 &820870478
GameObject:
m_ObjectHideFlags: 0
@@ -2887,6 +3216,42 @@ MeshCollider:
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: -3329902420748629119, guid: 823e8b39d52b71b4eb5a91dbc8d6d59e, type: 3}
--- !u!1 &1040246284 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 5071598280516985511, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
m_PrefabInstance: {fileID: 1810668922}
m_PrefabAsset: {fileID: 0}
--- !u!135 &1040246285
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1040246284}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.6015787
m_Center: {x: -0.024403572, y: 0.06938839, z: -0.52340984}
--- !u!1 &1089848562 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 5071598280516985511, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
m_PrefabInstance: {fileID: 814323979}
m_PrefabAsset: {fileID: 0}
--- !u!135 &1089848563
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1089848562}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.6015787
m_Center: {x: -0.024403572, y: 0.06938839, z: -0.52340984}
--- !u!1 &1111479331 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2550463727306718371, guid: 823e8b39d52b71b4eb5a91dbc8d6d59e, type: 3}
@@ -5196,6 +5561,239 @@ MeshCollider:
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 8552134717624371188, guid: 823e8b39d52b71b4eb5a91dbc8d6d59e, type: 3}
--- !u!1001 &1810668922
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_RootOrder
value: 12
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalScale.x
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalScale.y
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalScale.z
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalPosition.x
value: 4.213
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalPosition.y
value: 1.347
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalPosition.z
value: 2.483
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2236875552107647873, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_Layer
value: 7
objectReference: {fileID: 0}
- target: {fileID: 3709710254213546924, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_Layer
value: 7
objectReference: {fileID: 0}
- target: {fileID: 3884320679152247161, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_Layer
value: 7
objectReference: {fileID: 0}
- target: {fileID: 5071598280516985511, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_Name
value: Grenade (2)
objectReference: {fileID: 0}
- target: {fileID: 5071598280516985511, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_Layer
value: 7
objectReference: {fileID: 0}
- target: {fileID: 5204381087217674634, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: dropForce
value: 10
objectReference: {fileID: 0}
- target: {fileID: 5204381087217674634, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: grenadeRadius
value: 3
objectReference: {fileID: 0}
- target: {fileID: 5204381087217674634, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: hasBeenThrown
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5204381087217674634, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: explosionForce
value: 500
objectReference: {fileID: 0}
- target: {fileID: 5918420165866215312, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalPosition.x
value: -0.041
objectReference: {fileID: 0}
- target: {fileID: 5918420165866215312, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalPosition.y
value: 0.057
objectReference: {fileID: 0}
- target: {fileID: 5918420165866215312, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalPosition.z
value: -0.53
objectReference: {fileID: 0}
- target: {fileID: 5918420165866215314, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 2100000, guid: 7e832beb11d0b11499c8a1b3b4e52e78, type: 2}
- target: {fileID: 5918420165866215318, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_Layer
value: 7
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: grenadeRadius
value: 5
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: showExplosion
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: explosionForce
value: 600
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: explodeParticle
value:
objectReference: {fileID: 842071826}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeRadius
value: 200
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: lengthOfExplosion
value: 0.1
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeDuration
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.size
value: 3
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].time
value: 0.004529953
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].time
value: 0.47748455
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].time
value: 3.651196
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].value
value: 0.008758545
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].value
value: 3.9823725
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].value
value: 1.3784328
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].inSlope
value: 8.401682
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].inSlope
value: -2.910338
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].inSlope
value: -0.82047147
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].inWeight
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].outSlope
value: 8.401682
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].inWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].outSlope
value: -2.910338
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].inWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].outSlope
value: -0.82047147
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].outWeight
value: 0.33333334
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].outWeight
value: 0.09326189
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[0].tangentMode
value: 34
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[1].tangentMode
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9082234699677627348, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: cameraShakeCurve.m_Curve.Array.data[2].tangentMode
value: 34
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
--- !u!1 &1865591116
GameObject:
m_ObjectHideFlags: 0

View File

@@ -24,26 +24,19 @@ public class DebugCanvas : MonoBehaviour
}
private void Update()
{
if(Player == null)
{
try
{
if(Player == null) {
try {
Player = GameObject.FindGameObjectWithTag("Player").gameObject;
shoot = Player.GetComponent<Shoot>();
Debug.Log("Player Found");
}
catch
{
catch {
//Debug.Log("DEBUG CANVAS PLAYER NOT YET FOUND");
}
}
else
{
} else {
DebugTextGrounded.text = "isGrounded: " + Player.GetComponent<PlayerController>().isGrounded.ToString();
if (Player)
{
DebugAmmunition.text = shoot.CurAmmo + " / " + shoot.TotalAmmo;
if (Player) {
DebugAmmunition.text = shoot.CurAmmo.ToString() + " / " + shoot.TotalAmmo.ToString();
}
deltaTime += (Time.deltaTime - deltaTime) * 0.1f;
float fps = 1.0f / deltaTime;

View File

@@ -8,14 +8,11 @@ public class Player : NetworkBehaviour
public bool isAlive = true;
public Team team;
[SerializeField]PlayerUIController playerUIController;
[SerializeField] PlayerUIController playerUIController;
[SerializeField] private const int defaultHp = 100;
GameObject GameManager;
GameMaster gameMaster;
public ulong clientId;
[SyncVar(hook = nameof(SetName))]
@@ -23,10 +20,15 @@ public class Player : NetworkBehaviour
[SerializeField] GameObject usernameTextObj;
[SerializeField] [SyncVar]public int health = 100;
[SerializeField] [SyncVar] public int health = 100;
private int kills;
private int deaths;
[SerializeField] GameObject playerNeck;
[SerializeField] Camera playerCamera;
public GameObject PlayerNeck { get => playerNeck; set => playerNeck = value; }
public Camera PlayerCamera { get => playerCamera; }
private void Start()
{

View File

@@ -91,6 +91,8 @@ public class ProcedualAnimationController : NetworkBehaviour
float zVelocity = 0f;
int recoilCounter = 0;
[Header("Switch Settings")]
[Range(0, 1)] public float switchVal = 0;
[Header("Aiming Settings")]
[SerializeField] float aimSpeed = 0.01f;
@@ -99,8 +101,8 @@ public class ProcedualAnimationController : NetworkBehaviour
[SerializeField] GameObject HoldPoint;
public bool isAiming = false;
Vector3[] positionMod = new Vector3[3];
public Quaternion[] rotationMod = new Quaternion[3];
Vector3[] positionMod = new Vector3[4];
public Quaternion[] rotationMod = new Quaternion[4];
public Transform GunRightHandREF { get => gunRightHandREF; set => gunRightHandREF = value; }
public Transform GunLeftHandREF { get => gunLeftHandREF; set => gunLeftHandREF = value; }
@@ -185,8 +187,8 @@ public class ProcedualAnimationController : NetworkBehaviour
{
if (isServer)
{
positionMod = new Vector3[3];
rotationMod = new Quaternion[3];
positionMod = new Vector3[4];
rotationMod = new Quaternion[4];
/*-----Recoil-----*/
calcRecoilOffset();
/*-----Position Recoil-----*/
@@ -247,6 +249,21 @@ public class ProcedualAnimationController : NetworkBehaviour
aimVal = gravityValue(aimVal, aimSpeed, 1, 0, isAiming);
positionMod[2] = Vector3.Lerp(HoldPoint.transform.localPosition, AimPoint.transform.localPosition, Mathf.Pow(aimVal, 1.3f));
}
public void changePistole(bool isSwitching) { // Moves hands doooown ;) and up again NOT WORKING
//aimVal = gravityValue(aimVal, aimSpeed, 1, 0, isSwitching);
Vector3 b = new Vector3(HoldPoint.transform.localPosition.x, 1, HoldPoint.transform.localPosition.z);
//Debug.Log("HALLO: " + positionMod[3]);
positionMod[3] = Vector3.Lerp(HoldPoint.transform.localPosition, b, 0.5f);
//Debug.Log("HALLO: " + positionMod[3]);
}
public void changeRifle(bool isSwitching) { // Moves hands up and doooown again ;)
//aimVal = gravityValue(aimVal, aimSpeed, 1, 0, isSwitching);
Vector3 b = new Vector3(HoldPoint.transform.localPosition.x, HoldPoint.transform.localPosition.y + 1, HoldPoint.transform.localPosition.z);
positionMod[3] = Vector3.Lerp(HoldPoint.transform.localPosition, b, 0);
//Debug.Log("HALLO2");
}
void calcRecoilOffset()
{
for (int i = 0; i < recoilCounter; i++)

View File

@@ -13,16 +13,24 @@ public class Grenade : MonoBehaviour
[Tooltip("After how many seconds the explosion Gameobject gets deleted!")]
[SerializeField] float lengthOfExplosion = 1;
private float countdown;
[Header("Camera Shake Info")] // NOT WOKRING BECAUSE THE CAMERA IS FIXED IN PLACE
[SerializeField] bool cameraShakeActive = true;
[SerializeField] float cameraShakeRadius = 6f;
[SerializeField] float cameraShakeDuration = 1f;
[SerializeField] AnimationCurve cameraShakeCurve;
[Header("Explosion GameObject")]
[SerializeField] GameObject explodeParticle;
[Header("Scripts")]
[SerializeField] Weapon weapon;
[SerializeField] Weapon weapon;
[Header("Debug")]
[SerializeField] bool showExplosion = true;
// To change it from other scripts
public bool CameraShakeActive { get => cameraShakeActive; set => cameraShakeActive = value; }
void Start() {
countdown = timer;
}
@@ -43,23 +51,58 @@ public class Grenade : MonoBehaviour
/* - Spawn explosion particles and add force to nearby objects - */
private void Explode() {
if (showExplosion)
{
if (showExplosion) {
// Spawns explosion particle
GameObject spawnedExplosion = Instantiate(explodeParticle, transform.position, transform.rotation);
// Destroys explosion particle after on second
Destroy(spawnedExplosion, lengthOfExplosion);
}
if (cameraShakeActive) {
// Coroutine for camera shake to nearby Players
StartCoroutine(cameraShake());
}
// Coroutine for adding explosion force to nearby objects
StartCoroutine(addExplosionForce());
// Destroys grenade
Destroy(gameObject);
}
IEnumerator cameraShake() {
Collider[] colliders = Physics.OverlapSphere(transform.position, cameraShakeRadius);
foreach(Collider nearbyObject in colliders){
if (nearbyObject.GetComponent<Player>() && nearbyObject.GetType() != typeof(UnityEngine.CharacterController)) {
// Start coroutine that shakes the camera
StartCoroutine(shaking(nearbyObject));
}
}
yield return null;
}
IEnumerator shaking(Collider obj) {
// Getting neck from player
GameObject neck = obj.GetComponent<Player>().PlayerNeck;
Vector3 startPos = neck.transform.position;
float elapsedTime = 0f;
while(elapsedTime < cameraShakeDuration) {
elapsedTime += Time.deltaTime;
float strength = cameraShakeCurve.Evaluate(elapsedTime / cameraShakeDuration);
neck.transform.position = startPos + Random.insideUnitSphere * strength;
}
neck.transform.position = startPos;
yield return null;
}
IEnumerator addExplosionForce() {
// Gets all collider that are in a sphere around the grenade
Collider[] colliders = Physics.OverlapSphere(transform.position, grenadeRadius);
// Iterate over all colliders found in radius
foreach(Collider nearbyObject in colliders) {
foreach (Collider nearbyObject in colliders) {
// Check if nearby object is a Player and if Collider is not a CharacterController (can be changed to CapsuleCollider)
if (nearbyObject.transform.gameObject.GetComponent<Player>() && nearbyObject.GetType() != typeof(UnityEngine.CharacterController)) {
if (nearbyObject.GetComponent<Player>() && nearbyObject.GetType() != typeof(UnityEngine.CharacterController)) {
// Remove health from player
nearbyObject.transform.gameObject.GetComponent<Player>().RemoveHealth(weapon.Damage);
nearbyObject.GetComponent<Player>().RemoveHealth(weapon.Damage);
} else {
// Get Rigidbody from nearby object and...
Rigidbody rb = nearbyObject.GetComponent<Rigidbody>();
@@ -71,7 +114,6 @@ public class Grenade : MonoBehaviour
}
}
hasExploded = true;
// Destroys grenade
Destroy(gameObject);
yield return null;
}
}

View File

@@ -17,7 +17,6 @@ public class WeaponManager : NetworkBehaviour
[SerializeField] Camera cam;
private void Awake()
{
procedualAnimationController = GetComponent<ProcedualAnimationController>();
@@ -48,24 +47,28 @@ public class WeaponManager : NetworkBehaviour
}
}
}
public bool switchWeapon(int direction) {
// Get next active weapon index
int nextActive = searchForNext(activeWeapons, lastWeaponIndex, direction);
currentWeaponIndex = nextActive;
procedualAnimationController.OnSwitchWeapon(activeWeapons[currentWeaponIndex]);
shoot.setWeapon(activeWeapons[currentWeaponIndex]);
Weapon weaponData = activeWeapons[currentWeaponIndex].GetComponent<Weapon>();
procedualAnimationController.GunRightHandREF = weaponData.GunRightREF;
procedualAnimationController.GunLeftHandREF = weaponData.GunLeftREF;
// play weapon switch animation
switchAnimation(weaponData.WeaponKind.ToString()); // play weapon switch animation
return false;
}
private void switchAnimation(string weaponType) {
switch (weaponType) {
case "Rifle": procedualAnimationController.changeRifle(true); break;
case "Pistole": procedualAnimationController.changePistole(true); break;
case "Knife": ; procedualAnimationController.changePistole(true); break;
case "Grenade": ; procedualAnimationController.changePistole(true); break;
}
}
private int searchForNext(List<GameObject> l, int lastActive = 0, int direction = 1)
{
int current = lastActive + direction;