Added animation driver, SFX

This commit is contained in:
Jeremy Smitherman 2026-04-25 02:28:33 -05:00
parent 47956bdc6e
commit a84a4db880
20 changed files with 251 additions and 130 deletions

View File

@ -6,11 +6,16 @@
<component name="ChangeListManager">
<list default="true" id="60468364-7d9c-427f-83f9-f6cd83ef8783" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.idea.SpringJam2026/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.SpringJam2026/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/Spring/Idle.anim" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Spring/Idle.anim" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/Spring/Spring.anim" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Spring/Spring.anim" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/Catepillar/Fall.anim" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Catepillar/Fall.anim" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/Catepillar/Idle.anim" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Catepillar/Idle.anim" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/Catepillar/Jump.anim" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Catepillar/Jump.anim" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/Catepillar/Player.controller" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Catepillar/Player.controller" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/Catepillar/Player.prefab" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Catepillar/Player.prefab" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Prefabs/Catepillar/Walk.anim" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Prefabs/Catepillar/Walk.anim" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scenes/Bootstrap.unity" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scenes/Bootstrap.unity" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scenes/Game.unity" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scenes/Game.unity" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Management/SFX.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Management/SFX.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Assets/Scripts/Player/Movement.cs" beforeDir="false" afterPath="$PROJECT_DIR$/Assets/Scripts/Player/Movement.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ProjectSettings/TagManager.asset" beforeDir="false" afterPath="$PROJECT_DIR$/ProjectSettings/TagManager.asset" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -24,6 +29,7 @@
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="HighlightingSettingsPerFile">
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/500f267b66d74c678b3466bfed6b3d28212800/32/2bc2e6e7/Object.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/Scripts/Player/Movement.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/Scripts/State/Game/MainGameState.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/Assets/Scripts/State/Game/MainMenuState.cs" root0="FORCE_HIGHLIGHTING" />
@ -40,23 +46,23 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
"Attach to Unity Editor.Attach to Unity Editor.executor": "Debug",
"ModuleVcsDetector.initialDetectionPerformed": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"RunOnceActivity.git.unshallow": "true",
"git-widget-placeholder": "main",
"ignore.virus.scanning.warn.message": "true",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"vue.rearranger.settings.migration": "true"
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;ASKED_SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;,
&quot;Attach to Unity Editor.Attach to Unity Editor.executor&quot;: &quot;Debug&quot;,
&quot;ModuleVcsDetector.initialDetectionPerformed&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;main&quot;,
&quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}]]></component>
}</component>
<component name="RunManager" selected="Attach to Unity Editor.Attach to Unity Editor">
<configuration name="Start Unity" type="RunUnityExe" factoryName="Unity Executable">
<option name="EXE_PATH" value="C:\Program Files\Unity\Hub\Editor\6000.3.13f1\Editor\Unity.exe" />
@ -96,10 +102,10 @@
<option name="useMixedMode" value="false" />
<method v="2" />
</configuration>
<configuration name="Attach to Unity Editor" type="UNITY_DEBUG_RUN_CONFIGURATION" factoryName="Unity Debug" show_console_on_std_err="false" show_console_on_std_out="false" port="50000" address="localhost" ignored-value-for-modified-check="159424">
<configuration name="Attach to Unity Editor" type="UNITY_DEBUG_RUN_CONFIGURATION" factoryName="Unity Debug" show_console_on_std_err="false" show_console_on_std_out="false" port="50000" address="localhost" ignored-value-for-modified-check="194980">
<option name="allowRunningInParallel" value="false" />
<option name="listenPortForConnections" value="false" />
<option name="pid" value="159424" />
<option name="pid" value="194980" />
<option name="projectPathOnTarget" />
<option name="runtimes">
<list>
@ -124,6 +130,7 @@
<option name="presentableId" value="Default" />
<updated>1777050991106</updated>
<workItem from="1777050993247" duration="19210000" />
<workItem from="1777098508515" duration="3575000" />
</task>
<servers />
</component>

8
Assets/Audio/SFX.meta Normal file
View File

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

BIN
Assets/Audio/SFX/bump.aiff Normal file

Binary file not shown.

View File

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

BIN
Assets/Audio/SFX/jump.mp3 (Stored with Git LFS) Normal file

Binary file not shown.

View File

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

BIN
Assets/Audio/SFX/pickup.mp3 (Stored with Git LFS) Normal file

Binary file not shown.

View File

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

BIN
Assets/Audio/SFX/spring.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

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

View File

@ -23,7 +23,7 @@ AnimationClip:
- time: 0
value: {fileID: -2070610911, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3}
attribute: m_Sprite
path:
path: Sprite
classID: 212
script: {fileID: 0}
flags: 2
@ -35,7 +35,7 @@ AnimationClip:
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
path: 850496168
attribute: 0
script: {fileID: 0}
typeID: 212

View File

@ -23,7 +23,7 @@ AnimationClip:
- time: 0
value: {fileID: 5487822846996609747, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3}
attribute: m_Sprite
path:
path: Sprite
classID: 212
script: {fileID: 0}
flags: 2
@ -35,7 +35,7 @@ AnimationClip:
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
path: 850496168
attribute: 0
script: {fileID: 0}
typeID: 212

View File

@ -23,7 +23,7 @@ AnimationClip:
- time: 0
value: {fileID: 9201126744234322706, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3}
attribute: m_Sprite
path:
path: Sprite
classID: 212
script: {fileID: 0}
flags: 2
@ -35,7 +35,7 @@ AnimationClip:
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
path: 850496168
attribute: 0
script: {fileID: 0}
typeID: 212
@ -55,7 +55,7 @@ AnimationClip:
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0

View File

@ -10,7 +10,7 @@ AnimatorStateTransition:
m_Conditions:
- m_ConditionMode: 4
m_ConditionEvent: vspeed
m_EventTreshold: 0
m_EventTreshold: -0.2
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 705262314255223608}
m_Solo: 0
@ -70,7 +70,7 @@ AnimatorStateMachine:
m_Position: {x: 290, y: 10, z: 0}
- serializedVersion: 1
m_State: {fileID: 705262314255223608}
m_Position: {x: 570, y: -40, z: 0}
m_Position: {x: 50, y: -70, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions:
- {fileID: 2479910129929821769}
@ -93,7 +93,7 @@ AnimatorStateTransition:
m_Conditions:
- m_ConditionMode: 4
m_ConditionEvent: vspeed
m_EventTreshold: 0
m_EventTreshold: -0.2
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 705262314255223608}
m_Solo: 0
@ -107,7 +107,7 @@ AnimatorStateTransition:
m_HasFixedDuration: 0
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
m_CanTransitionToSelf: 0
--- !u!1102 &-4553251249938837047
AnimatorState:
serializedVersion: 6
@ -282,7 +282,7 @@ AnimatorStateTransition:
m_HasFixedDuration: 0
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
m_CanTransitionToSelf: 0
--- !u!1101 &3950393567183418223
AnimatorStateTransition:
m_ObjectHideFlags: 1

View File

@ -13,9 +13,10 @@ GameObject:
- component: {fileID: 849756540516150458}
- component: {fileID: 4169369283586250626}
- component: {fileID: 3534034070345576868}
- component: {fileID: 4576448781989217082}
m_Layer: 0
m_Name: Player
m_TagString: Untagged
m_TagString: Player
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
@ -93,7 +94,7 @@ CapsuleCollider2D:
m_CompositeOperation: 0
m_CompositeOrder: 0
m_Offset: {x: 0.23512886, y: 0.114549875}
m_Size: {x: 1, y: 0.65625}
m_Size: {x: 1, y: 0.75}
m_Direction: 1
--- !u!50 &4169369283586250626
Rigidbody2D:
@ -134,9 +135,50 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 35cab81567d235b489aef6d0fa17c729, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Player.Movement
runSpeed: 1
springPower: 0
spriteRenderer: {fileID: 0}
runSpeed: 4
springPower: 12
jumpForce: 5
airJumpForce: 10
spriteRenderer: {fileID: 342790821639359709}
turnDelay: 0.08
interactReference: {fileID: 1781555164194001046, guid: 2bcd2660ca9b64942af0de543d8d7100, type: 3}
impactPauseTime: 0.2
bouncePower: 5
animator: {fileID: 2598533458249844269}
jumpSound: {fileID: 8300000, guid: 0734beac3512cee4783e5a66f9df87bb, type: 3}
pickupSound: {fileID: 8300000, guid: 4f190d6dc258d8f4b843f97dd0e5d2db, type: 3}
springSound: {fileID: 8300000, guid: 07e96691431e68849b974e73b4e1dc2c, type: 3}
bumpSound: {fileID: 8300000, guid: 7c28608e819f6574193756354a7974fe, type: 3}
--- !u!114 &4576448781989217082
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7621021177568661959}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.InputSystem::UnityEngine.InputSystem.PlayerInput
m_Actions: {fileID: -944628639613478452, guid: 2bcd2660ca9b64942af0de543d8d7100, type: 3}
m_NotificationBehavior: 3
m_UIInputModule: {fileID: 0}
m_DeviceLostEvent:
m_PersistentCalls:
m_Calls: []
m_DeviceRegainedEvent:
m_PersistentCalls:
m_Calls: []
m_ControlsChangedEvent:
m_PersistentCalls:
m_Calls: []
m_ActionEvents: []
m_NeverAutoSwitchControlSchemes: 0
m_DefaultControlScheme:
m_DefaultActionMap: Player
m_SplitScreenIndex: -1
m_Camera: {fileID: 0}
--- !u!1 &8270890549788907285
GameObject:
m_ObjectHideFlags: 0

View File

@ -21,11 +21,11 @@ AnimationClip:
- serializedVersion: 2
curve:
- time: 0
value: {fileID: 5487822846996609747, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3}
- time: 0.083333336
value: {fileID: -835469789631162461, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3}
- time: 0.083333336
value: {fileID: 5487822846996609747, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3}
attribute: m_Sprite
path:
path: Sprite
classID: 212
script: {fileID: 0}
flags: 2
@ -37,7 +37,7 @@ AnimationClip:
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
path: 850496168
attribute: 0
script: {fileID: 0}
typeID: 212
@ -46,8 +46,8 @@ AnimationClip:
isIntCurve: 0
isSerializeReferenceCurve: 0
pptrCurveMapping:
- {fileID: 5487822846996609747, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3}
- {fileID: -835469789631162461, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3}
- {fileID: 5487822846996609747, guid: b960c99507aa1a84a8f28bdcbcc81c19, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}

View File

@ -324,7 +324,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!114 &1671688484
MonoBehaviour:
m_ObjectHideFlags: 0
@ -361,7 +361,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1671688483}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4b256c4001284134990a2af43c375455, type: 3}
m_Name:

View File

@ -705,7 +705,7 @@ Transform:
m_GameObject: {fileID: 972659586}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@ -995,7 +995,7 @@ MonoBehaviour:
m_RefResolutionX: 256
m_RefResolutionY: 154
m_CropFrame: 2
m_GridSnapping: 1
m_GridSnapping: 0
m_FilterMode: 0
m_UpscaleRT: 0
m_PixelSnapping: 0
@ -1016,11 +1016,6 @@ MonoBehaviour:
m_EditorClassIdentifier: Assembly-CSharp::Cam
camSpeed: 20
yOffset: 1
--- !u!212 &1111270482 stripped
SpriteRenderer:
m_CorrespondingSourceObject: {fileID: 342790821639359709, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3}
m_PrefabInstance: {fileID: 2062647807}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1552194188
GameObject:
m_ObjectHideFlags: 0
@ -1047,7 +1042,7 @@ Transform:
m_GameObject: {fileID: 1552194188}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.73, y: -0.4, z: 0}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@ -4981,7 +4976,7 @@ Transform:
m_GameObject: {fileID: 1718672489}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -4.37, y: 12.95, z: 0}
m_LocalPosition: {x: -2.46, y: 10.74, z: 0}
m_LocalScale: {x: 0.8, y: 0.8, z: 0.8}
m_ConstrainProportionsScale: 0
m_Children:
@ -5150,41 +5145,6 @@ BoxCollider2D:
m_AutoTiling: 0
m_Size: {x: 2, y: 0.5}
m_EdgeRadius: 0
--- !u!1 &1892581088 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7621021177568661959, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3}
m_PrefabInstance: {fileID: 2062647807}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1892581094
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1892581088}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.InputSystem::UnityEngine.InputSystem.PlayerInput
m_Actions: {fileID: -944628639613478452, guid: 2bcd2660ca9b64942af0de543d8d7100, type: 3}
m_NotificationBehavior: 3
m_UIInputModule: {fileID: 0}
m_DeviceLostEvent:
m_PersistentCalls:
m_Calls: []
m_DeviceRegainedEvent:
m_PersistentCalls:
m_Calls: []
m_ControlsChangedEvent:
m_PersistentCalls:
m_Calls: []
m_ActionEvents: []
m_NeverAutoSwitchControlSchemes: 0
m_DefaultControlScheme:
m_DefaultActionMap: Player
m_SplitScreenIndex: -1
m_Camera: {fileID: 1102711993}
--- !u!1 &2032829252
GameObject:
m_ObjectHideFlags: 0
@ -5247,7 +5207,7 @@ Transform:
m_GameObject: {fileID: 2032829252}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 2.85, y: 10.4, z: 0}
m_LocalPosition: {x: 2.59, y: 8.82, z: 0}
m_LocalScale: {x: 0.8, y: 0.8, z: 0.8}
m_ConstrainProportionsScale: 0
m_Children:
@ -5262,38 +5222,14 @@ PrefabInstance:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 849756540516150458, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3}
propertyPath: m_Size.y
value: 0.75
- target: {fileID: 342790821639359709, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3}
propertyPath: m_SortingOrder
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3534034070345576868, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3}
propertyPath: runSpeed
value: 4
objectReference: {fileID: 0}
- target: {fileID: 3534034070345576868, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3}
propertyPath: jumpForce
value: 5
objectReference: {fileID: 0}
- target: {fileID: 3534034070345576868, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3}
propertyPath: turnDelay
value: 0.08
objectReference: {fileID: 0}
- target: {fileID: 3534034070345576868, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3}
propertyPath: springPower
value: 12
objectReference: {fileID: 0}
- target: {fileID: 3534034070345576868, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3}
propertyPath: airJumpForce
value: 10
objectReference: {fileID: 0}
- target: {fileID: 3534034070345576868, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3}
propertyPath: spriteRenderer
- target: {fileID: 4576448781989217082, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3}
propertyPath: m_Camera
value:
objectReference: {fileID: 1111270482}
- target: {fileID: 3534034070345576868, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3}
propertyPath: interactReference
value:
objectReference: {fileID: 1781555164194001046, guid: 2bcd2660ca9b64942af0de543d8d7100, type: 3}
objectReference: {fileID: 1102711993}
- target: {fileID: 6196444245332325679, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3}
propertyPath: m_LocalPosition.x
value: -6.31
@ -5338,17 +5274,10 @@ PrefabInstance:
propertyPath: m_Name
value: Player
objectReference: {fileID: 0}
- target: {fileID: 7621021177568661959, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3}
propertyPath: m_TagString
value: Player
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 7621021177568661959, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3}
insertIndex: -1
addedObject: {fileID: 1892581094}
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: fbc05a08dfccd6a4cb1bcc1cf1910065, type: 3}
--- !u!1660057539 &9223372036854775807
SceneRoots:

View File

@ -21,7 +21,7 @@ namespace Management
private AudioSource _audioSource;
// Playing clip registry. Used as data source to limit amount of times a clip will play simultaneously
private Dictionary<AudioClip, int> _clipsInProgress;
private Dictionary<AudioClip, int> _clipsInProgress = new Dictionary<AudioClip, int>();
/// <summary>
/// Plpays the given audio clip through the audio driver

View File

@ -1,4 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Management;
using UnityEngine;
@ -10,6 +11,9 @@ namespace Player
public class Movement : MonoBehaviour
{
private static readonly int Spring = Animator.StringToHash("spring");
private static readonly int Grounded = Animator.StringToHash("grounded");
private static readonly int Speed = Animator.StringToHash("speed");
private static readonly int Vspeed = Animator.StringToHash("vspeed");
[SerializeField] private float runSpeed;
[SerializeField] private float springPower;
[SerializeField] private float jumpForce;
@ -17,6 +21,15 @@ namespace Player
[SerializeField] private SpriteRenderer spriteRenderer;
[SerializeField] private float turnDelay;
[SerializeField] private InputActionReference interactReference;
[SerializeField] private float impactPauseTime;
[SerializeField] private float bouncePower;
[SerializeField] private Animator animator;
[Header("Audio")]
[SerializeField] private AudioClip jumpSound;
[SerializeField] private AudioClip pickupSound;
[SerializeField] private AudioClip springSound;
[SerializeField] private AudioClip bumpSound;
private Animator _springAnimator;
private Rigidbody2D _rb;
@ -66,6 +79,8 @@ namespace Player
_groundedCheckTimer += Time.deltaTime;
_turnDelayTimer += Time.deltaTime;
if (!_autoDrive && Mathf.Abs(_rb.linearVelocityX) > 0.1f)
_facingLeft = _rb.linearVelocity.x < 0;
spriteRenderer.flipX = !_facingLeft;
if (_springAnimator && _jumpPressedThisFrame)
{
@ -87,7 +102,6 @@ namespace Player
if (!_grounded && _airJumpCharges > 0 && _jumpPressedThisFrame)
{
Debug.Log(_airJumpDir);
_airJump = true;
}
@ -98,6 +112,7 @@ namespace Player
{
if (_jump)
{
Services.Instance.SFX.PlayOneShot(jumpSound);
_jump = false;
_grounded = false;
_rb.AddForce(Vector2.up * jumpForce, ForceMode2D.Impulse);
@ -105,13 +120,17 @@ namespace Player
if (_airJump)
{
Services.Instance.SFX.PlayOneShot(jumpSound);
StartCoroutine(ImpactPause(impactPauseTime));
_airJump = false;
_airJumpCharges--;
_rb.linearVelocity = Vector3.zero;
_rb.AddForce(_airJumpDir * airJumpForce, ForceMode2D.Impulse);
}
if (_fireSpring)
{
Services.Instance.SFX.PlayOneShot(springSound);
_fireSpring = false;
_rb.linearVelocityX = 0;
_rb.AddForce(Vector2.up * springPower, ForceMode2D.Impulse);
@ -120,14 +139,26 @@ namespace Player
{
_rb.linearVelocityX = _facingLeft ? -runSpeed : runSpeed;
}
animator.SetBool(Grounded, _grounded);
animator.SetFloat(Speed, Mathf.Abs(_rb.linearVelocity.x));
animator.SetFloat(Vspeed, _rb.linearVelocity.y);
}
private IEnumerator ImpactPause(float pauseTime)
{
Time.timeScale = 0f;
yield return new WaitForSecondsRealtime(pauseTime);
Time.timeScale = 1f;
}
private void OnTriggerEnter2D(Collider2D other)
{
if (other.gameObject.layer == LayerMask.NameToLayer("Spring"))
_springAnimator = other.gameObject.GetComponent<Animator>();
if (other.gameObject.layer == LayerMask.NameToLayer("Pickup"))
{
Services.Instance.SFX.PlayOneShot(pickupSound);
_airJumpCharges++;
Destroy(other.gameObject);
}
@ -166,6 +197,9 @@ namespace Player
{
_facingLeft = !_facingLeft;
_turnDelayTimer = 0f;
if (!_autoDrive)
_rb.AddForce(new Vector2(x, 0f) * bouncePower, ForceMode2D.Impulse);
Services.Instance.SFX.PlayOneShot(bumpSound);
break;
}
}