Pull request #20: Sound addings

Merge in CEGJ/32bit_jam_conjure from Sound to Dev

* commit '46946fd0282ea4864792a126c722250824045ce9':
  Add music and ambiance prefabs with temp music file
  Added sounds to player scripts
This commit is contained in:
Louis Horlaville 2022-10-29 21:21:18 +00:00
commit 7475e4ce73
14 changed files with 660 additions and 44 deletions

View File

@ -0,0 +1,130 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &6406271711128597758
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 808831785093953574}
- component: {fileID: 4945767092616751961}
m_Layer: 0
m_Name: Ambiance
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &808831785093953574
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6406271711128597758}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -74.2, y: 17.891605, z: 0.032423317}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &4945767092616751961
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6406271711128597758}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0b9d694cefc9b6848acfaff4bed8cc65
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

130
Assets/Prefabs/Music.prefab Normal file
View File

@ -0,0 +1,130 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &8571589110344635516
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1418671164770919128}
- component: {fileID: 4094901255911055533}
m_Layer: 0
m_Name: Music
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1418671164770919128
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8571589110344635516}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -74.2, y: 17.891605, z: 0.032423317}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &4094901255911055533
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8571589110344635516}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 1
m_Volume: 0.436
m_Pitch: 1
Loop: 1
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 92a7b11ea4b35924a9caf2ab6d443449
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -13,12 +13,14 @@ GameObject:
- component: {fileID: 1772573266731274169} - component: {fileID: 1772573266731274169}
- component: {fileID: 1772573266731274174} - component: {fileID: 1772573266731274174}
- component: {fileID: 1772573266731274173} - component: {fileID: 1772573266731274173}
- component: {fileID: 1772573266731274172}
- component: {fileID: 1772573266731274163} - component: {fileID: 1772573266731274163}
- component: {fileID: 8474203461765366282} - component: {fileID: 8474203461765366282}
- component: {fileID: 8078848171855759243}
- component: {fileID: 1772573266731274172}
- component: {fileID: 1447597341752185403} - component: {fileID: 1447597341752185403}
- component: {fileID: 1211811550} - component: {fileID: 1211811550}
- component: {fileID: 1211811541} - component: {fileID: 1211811541}
- component: {fileID: 2761483155973167578}
m_Layer: 8 m_Layer: 8
m_Name: Player m_Name: Player
m_TagString: Player m_TagString: Player
@ -108,7 +110,7 @@ Rigidbody:
m_UseGravity: 1 m_UseGravity: 1
m_IsKinematic: 0 m_IsKinematic: 0
m_Interpolate: 0 m_Interpolate: 0
m_Constraints: 8 m_Constraints: 120
m_CollisionDetection: 2 m_CollisionDetection: 2
--- !u!114 &1772573266731274173 --- !u!114 &1772573266731274173
MonoBehaviour: MonoBehaviour:
@ -122,6 +124,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 5f45bd04209bb424e8b1f5271cb16ab0, type: 3} m_Script: {fileID: 11500000, guid: 5f45bd04209bb424e8b1f5271cb16ab0, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
soundPlayer: {fileID: 8078848171855759243}
maxGrappleDist: 15 maxGrappleDist: 15
grappleExtensionSpeed: 2.5 grappleExtensionSpeed: 2.5
grappleStrength: 40 grappleStrength: 40
@ -135,6 +138,59 @@ MonoBehaviour:
gunPos: {fileID: 1772573266917019329} gunPos: {fileID: 1772573266917019329}
canvasRect: {fileID: 0} canvasRect: {fileID: 0}
hitMarkerRect: {fileID: 0} hitMarkerRect: {fileID: 0}
--- !u!114 &1772573266731274163
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1772573266731274171}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 60e46f6febb0d4a4592dd894365ffeb2, type: 3}
m_Name:
m_EditorClassIdentifier:
rb: {fileID: 1772573266731274174}
soundPlayer: {fileID: 8078848171855759243}
canWalk: 1
canJump: 1
movementSpeed: 0.8
maxMovementSpeed: 28
jumpPower: 3
afterJumpHorizontalSlowdownTime: 1
groundDrag: 1
airDrag: 0
playerHeight: 0.6
jumpAirSlowdown: 80
groundHitSoundVelocity: 24
grappleHook: {fileID: 1772573266731274173}
isGrounded: 0
--- !u!114 &8474203461765366282
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1772573266731274171}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b5fa9960655cb742880ef94db81ca9c, type: 3}
m_Name:
m_EditorClassIdentifier:
soundPlayer: {fileID: 8078848171855759243}
--- !u!114 &8078848171855759243
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1772573266731274171}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6fb36fee47a0d6a44bc2237dfbdac4d5, type: 3}
m_Name:
m_EditorClassIdentifier:
playableSounds: []
--- !u!114 &1772573266731274172 --- !u!114 &1772573266731274172
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -262,43 +318,6 @@ MonoBehaviour:
m_DefaultActionMap: Player m_DefaultActionMap: Player
m_SplitScreenIndex: -1 m_SplitScreenIndex: -1
m_Camera: {fileID: 0} m_Camera: {fileID: 0}
--- !u!114 &1772573266731274163
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1772573266731274171}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 60e46f6febb0d4a4592dd894365ffeb2, type: 3}
m_Name:
m_EditorClassIdentifier:
rb: {fileID: 1772573266731274174}
canWalk: 1
canJump: 1
movementSpeed: 0.8
maxMovementSpeed: 30
jumpPower: 3
afterJumpHorizontalSlowdownTime: 1
groundDrag: 1
airDrag: 0
playerHeight: 0.6
jumpAirSlowdown: 80
grappleHook: {fileID: 1772573266731274173}
isGrounded: 0
--- !u!114 &8474203461765366282
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1772573266731274171}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b5fa9960655cb742880ef94db81ca9c, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!136 &1447597341752185403 --- !u!136 &1447597341752185403
CapsuleCollider: CapsuleCollider:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -347,6 +366,102 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_startsRagdolled: 1 _startsRagdolled: 1
_hipBone: {fileID: 2527212996625801578} _hipBone: {fileID: 2527212996625801578}
--- !u!82 &2761483155973167578
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1772573266731274171}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!1 &1772573266864950258 --- !u!1 &1772573266864950258
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -2723,6 +2723,149 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0e12bf23a882b9d47b6b9b68e4e7a062, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 0e12bf23a882b9d47b6b9b68e4e7a062, type: 3}
--- !u!1001 &893636036601257466
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 808831785093953574, guid: 0b9d694cefc9b6848acfaff4bed8cc65,
type: 3}
propertyPath: m_RootOrder
value: 22
objectReference: {fileID: 0}
- target: {fileID: 808831785093953574, guid: 0b9d694cefc9b6848acfaff4bed8cc65,
type: 3}
propertyPath: m_LocalPosition.x
value: -74.2
objectReference: {fileID: 0}
- target: {fileID: 808831785093953574, guid: 0b9d694cefc9b6848acfaff4bed8cc65,
type: 3}
propertyPath: m_LocalPosition.y
value: 17.891605
objectReference: {fileID: 0}
- target: {fileID: 808831785093953574, guid: 0b9d694cefc9b6848acfaff4bed8cc65,
type: 3}
propertyPath: m_LocalPosition.z
value: 0.032423317
objectReference: {fileID: 0}
- target: {fileID: 808831785093953574, guid: 0b9d694cefc9b6848acfaff4bed8cc65,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 808831785093953574, guid: 0b9d694cefc9b6848acfaff4bed8cc65,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 808831785093953574, guid: 0b9d694cefc9b6848acfaff4bed8cc65,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 808831785093953574, guid: 0b9d694cefc9b6848acfaff4bed8cc65,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 808831785093953574, guid: 0b9d694cefc9b6848acfaff4bed8cc65,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 808831785093953574, guid: 0b9d694cefc9b6848acfaff4bed8cc65,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 808831785093953574, guid: 0b9d694cefc9b6848acfaff4bed8cc65,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6406271711128597758, guid: 0b9d694cefc9b6848acfaff4bed8cc65,
type: 3}
propertyPath: m_Name
value: Ambiance
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0b9d694cefc9b6848acfaff4bed8cc65, type: 3}
--- !u!1001 &934850289875368483
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1418671164770919128, guid: 92a7b11ea4b35924a9caf2ab6d443449,
type: 3}
propertyPath: m_RootOrder
value: 21
objectReference: {fileID: 0}
- target: {fileID: 1418671164770919128, guid: 92a7b11ea4b35924a9caf2ab6d443449,
type: 3}
propertyPath: m_LocalPosition.x
value: -74.2
objectReference: {fileID: 0}
- target: {fileID: 1418671164770919128, guid: 92a7b11ea4b35924a9caf2ab6d443449,
type: 3}
propertyPath: m_LocalPosition.y
value: 17.891605
objectReference: {fileID: 0}
- target: {fileID: 1418671164770919128, guid: 92a7b11ea4b35924a9caf2ab6d443449,
type: 3}
propertyPath: m_LocalPosition.z
value: 0.032423317
objectReference: {fileID: 0}
- target: {fileID: 1418671164770919128, guid: 92a7b11ea4b35924a9caf2ab6d443449,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1418671164770919128, guid: 92a7b11ea4b35924a9caf2ab6d443449,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1418671164770919128, guid: 92a7b11ea4b35924a9caf2ab6d443449,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1418671164770919128, guid: 92a7b11ea4b35924a9caf2ab6d443449,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1418671164770919128, guid: 92a7b11ea4b35924a9caf2ab6d443449,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1418671164770919128, guid: 92a7b11ea4b35924a9caf2ab6d443449,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1418671164770919128, guid: 92a7b11ea4b35924a9caf2ab6d443449,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4094901255911055533, guid: 92a7b11ea4b35924a9caf2ab6d443449,
type: 3}
propertyPath: m_audioClip
value:
objectReference: {fileID: 8300000, guid: ca051ddfd9879bb4783087293eb7e5a4, type: 3}
- target: {fileID: 8571589110344635516, guid: 92a7b11ea4b35924a9caf2ab6d443449,
type: 3}
propertyPath: m_Name
value: Music
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 92a7b11ea4b35924a9caf2ab6d443449, type: 3}
--- !u!1001 &1772573267671239019 --- !u!1001 &1772573267671239019
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -2,10 +2,12 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.InputSystem; using UnityEngine.InputSystem;
using Bytes.Sound;
public class CharacterMovement : MonoBehaviour public class CharacterMovement : MonoBehaviour
{ {
[SerializeField] private Rigidbody rb; [SerializeField] private Rigidbody rb;
[SerializeField] private SoundPlayer soundPlayer;
[Header("Enable switches")] [Header("Enable switches")]
[SerializeField] private bool canWalk; [SerializeField] private bool canWalk;
@ -22,9 +24,11 @@ public class CharacterMovement : MonoBehaviour
[SerializeField] private float airDrag; [SerializeField] private float airDrag;
[SerializeField] private float playerHeight; [SerializeField] private float playerHeight;
[SerializeField] private float jumpAirSlowdown; [SerializeField] private float jumpAirSlowdown;
[SerializeField] private float groundHitSoundVelocity;
[SerializeField] private GrappleHook grappleHook; [SerializeField] private GrappleHook grappleHook;
public bool isGrounded; public bool isGrounded;
private bool isStunned = false; private bool isStunned = false;
private bool canHitGround = true;
private Vector3 rawInputMovement; private Vector3 rawInputMovement;
private float afterJumpHorizontalSlowdownTimeCounter; private float afterJumpHorizontalSlowdownTimeCounter;
@ -146,4 +150,21 @@ public class CharacterMovement : MonoBehaviour
} }
} }
} }
private void OnCollisionEnter(Collision collision)
{
if(rb.velocity.magnitude>= groundHitSoundVelocity && canHitGround)
{
soundPlayer.PlaySound("PlayerGroudHit");
StartCoroutine(DelayGroundHit(.2f));
}
}
IEnumerator DelayGroundHit(float delay)
{
canHitGround = false;
yield return new WaitForSeconds(delay);
canHitGround = true;
}
} }

View File

@ -3,9 +3,11 @@ using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using UnityEngine.InputSystem; using UnityEngine.InputSystem;
using Bytes.Sound;
public class GrappleHook : MonoBehaviour public class GrappleHook : MonoBehaviour
{ {
[SerializeField] SoundPlayer soundPlayer;
[Header("Grapple settings")] [Header("Grapple settings")]
[SerializeField] [SerializeField]
@ -120,6 +122,8 @@ public class GrappleHook : MonoBehaviour
grappled = true; grappled = true;
grappling = false; grappling = false;
soundPlayer.PlaySound("PlayerGrappleHit");
//Display //Display
hitMarkerRect.gameObject.SetActive(false); hitMarkerRect.gameObject.SetActive(false);
@ -150,6 +154,10 @@ public class GrappleHook : MonoBehaviour
} }
private void EndGrapple(){ private void EndGrapple(){
if (grappled)
{
soundPlayer.PlaySound("PlayerGrappleDetach");
}
grappled = false; grappled = false;
grappling = false; grappling = false;
lr.enabled = false; lr.enabled = false;
@ -195,14 +203,17 @@ public void Unhook(GameObject hookedObj){
if(grappling && grappled)return; if(grappling && grappled)return;
if(context.performed){ if(context.performed){
grappling = true; grappling = true;
}else if(context.canceled){ soundPlayer.PlaySound("PlayerGrappleFire");
}
else if(context.canceled){
EndGrapple(); EndGrapple();
} }
} }
public void BoostToAnchor(InputAction.CallbackContext context){ public void BoostToAnchor(InputAction.CallbackContext context){
if(context.performed && grappled){ if(context.performed && grappled && !boosted){
boosted = true; boosted = true;
soundPlayer.PlaySound("PlayerGrappleBoost");
} }
} }

View File

@ -1,7 +1,6 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using Bytes.Sound; using Bytes.Sound;
public class PlayerController : MonoBehaviour public class PlayerController : MonoBehaviour
@ -9,7 +8,7 @@ public class PlayerController : MonoBehaviour
private GrappleHook grappleScript; private GrappleHook grappleScript;
private CharacterMovement movementScript; private CharacterMovement movementScript;
private Rigidbody rb; private Rigidbody rb;
SoundPlayer soundPlayer; [SerializeField] SoundPlayer soundPlayer;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
@ -32,6 +31,7 @@ public class PlayerController : MonoBehaviour
} }
public void Knockback(Vector2 dir){ public void Knockback(Vector2 dir){
soundPlayer.PlaySound("PlayerKnockback");
rb.AddForce(dir); rb.AddForce(dir);
} }
} }

8
Assets/Sounds.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2d1b6d3af796f834d862a9ba2cca6316
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: ca051ddfd9879bb4783087293eb7e5a4
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 7f8d6228f336a80488a93efc88764837
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant: