diff --git a/Assets/Art/Model/aocao.prefab b/Assets/Art/Model/aocao.prefab index de560fc..24decc0 100644 --- a/Assets/Art/Model/aocao.prefab +++ b/Assets/Art/Model/aocao.prefab @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d18d889b1bca3561998fb75b734c6bcb8f1658b0119d5458574e226bdcc1b881 -size 4803 +oid sha256:24ba2381df43ab4a73e1214498ccda7013e6f0899d518272586b032d82644d59 +size 7107 diff --git a/Assets/Art/SoundEffect/leisurely-walk-along-345731.mp3 b/Assets/Art/SoundEffect/leisurely-walk-along-345731.mp3 new file mode 100644 index 0000000..1865de2 Binary files /dev/null and b/Assets/Art/SoundEffect/leisurely-walk-along-345731.mp3 differ diff --git a/Assets/Art/SoundEffect/leisurely-walk-along-345731.mp3.meta b/Assets/Art/SoundEffect/leisurely-walk-along-345731.mp3.meta new file mode 100644 index 0000000..cc612ea --- /dev/null +++ b/Assets/Art/SoundEffect/leisurely-walk-along-345731.mp3.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 957dfe377c8f4334aa6baeb7f9e0e13a +AudioImporter: + externalObjects: {} + serializedVersion: 7 + 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: diff --git a/Assets/Prefab/Gameplay/Button.prefab b/Assets/Prefab/Gameplay/Button.prefab index dd8d9c9..126064b 100644 --- a/Assets/Prefab/Gameplay/Button.prefab +++ b/Assets/Prefab/Gameplay/Button.prefab @@ -15,6 +15,7 @@ GameObject: - component: {fileID: 162156210837205425} - component: {fileID: 4434834246038522293} - component: {fileID: 7931804082152492731} + - component: {fileID: 5405840786762141308} m_Layer: 0 m_Name: Button m_TagString: Untagged @@ -145,6 +146,9 @@ MonoBehaviour: isEnableSendSignal: 1 signalDuration: 1 buttonPressPoint: {fileID: 9183523148397755279} + turnSound: {fileID: 8300000, guid: 477fd4e31293f704f96ea5dfab139088, type: 3} + returnSound: {fileID: 8300000, guid: 55ca4d0dac5ebb7408f043347aa87cda, type: 3} + buttonSound: {fileID: 5405840786762141308} --- !u!114 &7931804082152492731 MonoBehaviour: m_ObjectHideFlags: 0 @@ -159,6 +163,102 @@ MonoBehaviour: m_EditorClassIdentifier: isEnableEdit: 1 isOpenInEditor: 1 +--- !u!82 &5405840786762141308 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2052340463965227198} + 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 &9183523148397755279 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefab/Gameplay/Lever.prefab b/Assets/Prefab/Gameplay/Lever.prefab index 6d88ff6..b6da2f1 100644 --- a/Assets/Prefab/Gameplay/Lever.prefab +++ b/Assets/Prefab/Gameplay/Lever.prefab @@ -242,6 +242,7 @@ GameObject: - component: {fileID: 4936355834716623489} - component: {fileID: 7767327858011138776} - component: {fileID: 3931680811062325468} + - component: {fileID: 792532805521400095} m_Layer: 0 m_Name: Lever m_TagString: Untagged @@ -287,6 +288,9 @@ MonoBehaviour: componentName: isEnableSendSignal: 1 rotationPrefab: {fileID: 5655992473923178902} + turnSound: {fileID: 8300000, guid: 477fd4e31293f704f96ea5dfab139088, type: 3} + returnSound: {fileID: 8300000, guid: 55ca4d0dac5ebb7408f043347aa87cda, type: 3} + LeverSound: {fileID: 792532805521400095} --- !u!65 &7767327858011138776 BoxCollider: m_ObjectHideFlags: 0 @@ -329,3 +333,99 @@ BoxCollider: serializedVersion: 3 m_Size: {x: 0.5, y: 2, z: 0.5} m_Center: {x: 0, y: 0.34, z: 0} +--- !u!82 &792532805521400095 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6227019518059310355} + 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 diff --git a/Assets/Prefab/Gameplay/Player.prefab b/Assets/Prefab/Gameplay/Player.prefab index a113ff9..1aa5830 100644 --- a/Assets/Prefab/Gameplay/Player.prefab +++ b/Assets/Prefab/Gameplay/Player.prefab @@ -156,6 +156,7 @@ GameObject: - component: {fileID: 5633281206562703781} - component: {fileID: 4616892119606260346} - component: {fileID: 3493211357972151578} + - component: {fileID: 327197785400436727} m_Layer: 8 m_Name: Player m_TagString: Player @@ -239,6 +240,9 @@ MonoBehaviour: groundMask: serializedVersion: 2 m_Bits: 64 + playerSound: {fileID: 327197785400436727} + jumpSound: {fileID: 8300000, guid: 5c8921fb34c226c47b32fd7563d635c8, type: 3} + walkSound: {fileID: 8300000, guid: 957dfe377c8f4334aa6baeb7f9e0e13a, type: 3} fallDamageThreshold: 3 pushPower: 0.5 --- !u!114 &2963170313432786625 @@ -348,6 +352,102 @@ MonoBehaviour: m_EditorClassIdentifier: isEnablePlayerDialogue: 1 firstPersonRaycaster: {fileID: 8217262775185484522} +--- !u!82 &327197785400436727 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3550102669167288263} + 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 &3610935294554348573 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefab/Gameplay/PressurePlate.prefab b/Assets/Prefab/Gameplay/PressurePlate.prefab index 070e5ce..1f50a84 100644 --- a/Assets/Prefab/Gameplay/PressurePlate.prefab +++ b/Assets/Prefab/Gameplay/PressurePlate.prefab @@ -15,6 +15,7 @@ GameObject: - component: {fileID: -7803032184951374842} - component: {fileID: 5936472319330568279} - component: {fileID: 6372441752678980756} + - component: {fileID: 1031207251367064294} m_Layer: 0 m_Name: PressurePlate m_TagString: Untagged @@ -128,6 +129,9 @@ MonoBehaviour: plateSize: {x: 2, y: 0.4, z: 2} plateOffset: {x: 0, y: 0.5, z: 0} pressTopPrefab: {fileID: 8314966853544917208} + pressedSound: {fileID: 8300000, guid: 477fd4e31293f704f96ea5dfab139088, type: 3} + returnSound: {fileID: 8300000, guid: 55ca4d0dac5ebb7408f043347aa87cda, type: 3} + plateSound: {fileID: 1031207251367064294} --- !u!114 &5936472319330568279 MonoBehaviour: m_ObjectHideFlags: 0 @@ -163,6 +167,102 @@ BoxCollider: serializedVersion: 3 m_Size: {x: 2, y: 2.0000005, z: 2.0000005} m_Center: {x: 0, y: 0, z: 0} +--- !u!82 &1031207251367064294 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2191333364839819432} + 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 &8314966853544917208 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Script/Gameplay/Facility/ButtonInteractController.cs b/Assets/Script/Gameplay/Facility/ButtonInteractController.cs index 95ec9c1..87f2f03 100644 --- a/Assets/Script/Gameplay/Facility/ButtonInteractController.cs +++ b/Assets/Script/Gameplay/Facility/ButtonInteractController.cs @@ -14,6 +14,10 @@ namespace Script.Gameplay.Facility private bool isPressing = false; private Vector3 buttonInitialPosition; + [SerializeField] private AudioClip turnSound; + [SerializeField] private AudioClip returnSound; + [SerializeField] private AudioSource buttonSound; + private void Awake() { buttonInitialPosition = buttonPressPoint.transform.position; @@ -37,12 +41,16 @@ namespace Script.Gameplay.Facility isPressing = true; // 按钮按下的动画或效果可以在这里添加 buttonPressPoint.transform.position = new Vector3(0, 0, 0); + buttonSound.clip = turnSound; + buttonSound.Play(); yield return new WaitForSeconds(signalDuration); SendSignal(false, this.gameObject); isPressing = false; // 按钮弹起的动画或效果可以在这里添加 buttonPressPoint.transform.position = buttonInitialPosition; + buttonSound.clip = returnSound; + buttonSound.Play(); } } diff --git a/Assets/Script/Gameplay/Facility/LeverInteractController.cs b/Assets/Script/Gameplay/Facility/LeverInteractController.cs index f59bfd6..ae921af 100644 --- a/Assets/Script/Gameplay/Facility/LeverInteractController.cs +++ b/Assets/Script/Gameplay/Facility/LeverInteractController.cs @@ -9,6 +9,9 @@ namespace Script.Gameplay.Facility { private bool isPulled = false; [SerializeField] private GameObject rotationPrefab; + [SerializeField] private AudioClip turnSound; + [SerializeField] private AudioClip returnSound; + [SerializeField] private AudioSource LeverSound; public override string GetInteractPrompt() { @@ -30,11 +33,15 @@ namespace Script.Gameplay.Facility { // 旋转拉杆到下拉位置 rotationPrefab.transform.rotation = Quaternion.Euler(0f, 0f, 45f); + LeverSound.clip = turnSound; + LeverSound.Play(); } else { // 旋转拉杆回到初始位置 rotationPrefab.transform.rotation = Quaternion.Euler(0f, 0f, 0f); + LeverSound.clip = returnSound; + LeverSound.Play(); } } } diff --git a/Assets/Script/Gameplay/Facility/PressurePlateController.cs b/Assets/Script/Gameplay/Facility/PressurePlateController.cs index 7481d6a..04dbcd6 100644 --- a/Assets/Script/Gameplay/Facility/PressurePlateController.cs +++ b/Assets/Script/Gameplay/Facility/PressurePlateController.cs @@ -11,6 +11,10 @@ namespace Script.Gameplay.Facility [SerializeField] private Vector3 plateOffset = Vector3.up * 0.1f; [SerializeField] private GameObject pressTopPrefab; + + [SerializeField] private AudioClip pressedSound; + [SerializeField] private AudioClip returnSound; + [SerializeField] private AudioSource plateSound; private bool lastState = false; private bool hasObject = false; @@ -27,13 +31,21 @@ namespace Script.Gameplay.Facility { // 被压下动画 if (pressTopPrefab != null) + { pressTopPrefab.transform.localPosition = new Vector3(0, 0, 0.1f); + plateSound.clip = pressedSound; + plateSound.Play(); + } } else { // 弹起动画 if (pressTopPrefab != null) + { pressTopPrefab.transform.localPosition = new Vector3(0, 0, 1); + plateSound.clip = returnSound; + plateSound.Play(); + } } } } diff --git a/Assets/Script/Gameplay/Player/PlayerMoveController.cs b/Assets/Script/Gameplay/Player/PlayerMoveController.cs index 7a48c70..3d90745 100644 --- a/Assets/Script/Gameplay/Player/PlayerMoveController.cs +++ b/Assets/Script/Gameplay/Player/PlayerMoveController.cs @@ -19,6 +19,10 @@ namespace Script.Gameplay.Player [Tooltip("地面检测半径")] public float groundDistance = 0.4f; [Tooltip("地面层(LayerMask)")] public LayerMask groundMask; + [Header("Sound Effects")] + [SerializeField] private AudioSource playerSound; + [SerializeField] private AudioClip jumpSound; + [SerializeField] private AudioClip walkSound; private float initSpeed; private CharacterController characterController; @@ -35,6 +39,10 @@ namespace Script.Gameplay.Player [Tooltip("推动物体的力量")] [SerializeField] private float pushPower = 2f; + [Header("Footstep Settings")] + [Tooltip("判定为走路的最小输入强度")] [SerializeField] + private float walkThreshold = 0.1f; + private void Awake() { characterController = GetComponent(); @@ -42,6 +50,9 @@ namespace Script.Gameplay.Player Debug.LogError("PlayerMoveController 需要 CharacterController 组件!"); initSpeed = speed; + playerSound = playerSound != null ? playerSound : GetComponent(); + if (playerSound == null) + Debug.LogWarning("PlayerMoveController: AudioSource 未设置,音效将不会播放。"); } private void Start() @@ -95,9 +106,17 @@ namespace Script.Gameplay.Player Vector3 move = transform.right * x + transform.forward * z; characterController.Move(move * speed * Time.deltaTime); + // 走路音效逻辑:在地面且移动输入较大时播放循环走路音效 + HandleFootstepAudio(x, z); + // 跳跃 if (isGrounded && inputManager.JumpPressed) { + // 跳跃时停止走路循环声并播放跳跃音效(一次性) + StopWalkAudioIfPlaying(); + if (playerSound != null && jumpSound != null) + playerSound.PlayOneShot(jumpSound); + velocity.y = Mathf.Sqrt(jumpHeight * -2f * gravity); } @@ -106,6 +125,45 @@ namespace Script.Gameplay.Player characterController.Move(velocity * Time.deltaTime); } + private void HandleFootstepAudio(float x, float z) + { + if (playerSound == null || walkSound == null) return; + + float inputMag = new Vector2(x, z).magnitude; + bool shouldPlayWalk = isGrounded && inputMag > walkThreshold; + + if (shouldPlayWalk) + { + if (playerSound.clip != walkSound || !playerSound.isPlaying) + { + playerSound.clip = walkSound; + playerSound.loop = true; + playerSound.Play(); + } + } + else + { + // 如果当前正在播放走路音效则停止 + if (playerSound.clip == walkSound && playerSound.isPlaying) + { + playerSound.Stop(); + playerSound.loop = false; + playerSound.clip = null; + } + } + } + + private void StopWalkAudioIfPlaying() + { + if (playerSound == null) return; + if (playerSound.clip == walkSound && playerSound.isPlaying) + { + playerSound.Stop(); + playerSound.loop = false; + playerSound.clip = null; + } + } + private void OnControllerColliderHit(ControllerColliderHit hit) { Rigidbody body = hit.collider.attachedRigidbody; @@ -114,7 +172,7 @@ namespace Script.Gameplay.Player { // 忽略从下方碰撞 if (hit.moveDirection.y < -0.3f) return; - + Vector3 pushDir = new Vector3(hit.moveDirection.x, 0, hit.moveDirection.z); body.AddForce(pushDir * pushPower, ForceMode.Impulse); } @@ -130,4 +188,4 @@ namespace Script.Gameplay.Player speed = initSpeed; } } -} \ No newline at end of file +}