From d16ac0cef108c8d319f30ce881102eb6b210f898 Mon Sep 17 00:00:00 2001 From: charnet3d Date: Tue, 16 Jan 2024 22:07:51 +0100 Subject: [PATCH] Section 11: Multiple Weapon Types - Lecture 219 Pistol reload animation --- .../Sounds/Pistol/PistolClipInsert.uasset | 3 +++ .../Sounds/Pistol/PistolClipInsert_Cue.uasset | 3 +++ .../Sounds/Pistol/PistolClipRemove.uasset | 3 +++ .../Sounds/Pistol/PistolClipRemove_Cue.uasset | 3 +++ .../Assets/Sounds/Pistol/PistolFire.uasset | 3 +++ .../Sounds/Pistol/PistolFire_Cue.uasset | 3 +++ .../Assets/Sounds/Rifle/Equip_01_Cue.uasset | 4 ++-- .../Assets/Sounds/Rifle/Equip_02_Cue.uasset | 3 --- .../Assets/Sounds/Rifle/Pistol_Equip.uasset | 3 +++ .../Assets/Sounds/Rifle/Swipe_1_Cue.uasset | 3 --- .../Sounds/Rifle/sw_Foley_Jump_03_Cue.uasset | 3 --- .../Sounds/Rifle/sw_Wep_AR_Equip_01.uasset | 4 ++-- .../Rifle/sw_Wep_AR_Equip_03_Cue.uasset | 3 --- .../sw_Wep_Launcher_Dryfire_01_Cue.uasset | 3 --- .../Crosshairs/Crosshair_Bracket_4.uasset | 4 ++-- .../Crosshairs/Crosshair_Circle_15.uasset | 4 ++-- .../Crosshair_Circle_15_outlined.uasset | 4 ++-- .../Crosshairs/Crosshair_Circle_9.uasset | 4 ++-- .../Crosshair_Bracket_4.uasset | 3 +++ .../Crosshair_Circle_15.uasset | 3 +++ .../Crosshair_Circle_15_outlined.uasset | 3 +++ .../Crosshair_Circle_9.uasset | 3 +++ .../Icons/WeaponIcons/PistolIcon.uasset | 3 +++ .../Character/Animations/ReloadMontage.uasset | 4 ++-- .../Retargeted/Reloading/Reload_Pistol.uasset | 3 +++ .../_Game/DataTable/WeaponDataTable.uasset | 4 ++-- Content/_Game/Maps/DefaultMap.umap | 4 ++-- .../Materials/ARMaterials/M_AR_Mat.uasset | 4 ++-- .../_Game/Weapons/Meshes/Belica_Pistol.uasset | 3 +++ Source/Shooter/Weapon.cpp | 19 +++++++++++++++++++ Source/Shooter/Weapon.h | 9 +++++++++ Source/Shooter/WeaponType.h | 1 + 32 files changed, 91 insertions(+), 35 deletions(-) create mode 100644 Content/_Game/Assets/Sounds/Pistol/PistolClipInsert.uasset create mode 100644 Content/_Game/Assets/Sounds/Pistol/PistolClipInsert_Cue.uasset create mode 100644 Content/_Game/Assets/Sounds/Pistol/PistolClipRemove.uasset create mode 100644 Content/_Game/Assets/Sounds/Pistol/PistolClipRemove_Cue.uasset create mode 100644 Content/_Game/Assets/Sounds/Pistol/PistolFire.uasset create mode 100644 Content/_Game/Assets/Sounds/Pistol/PistolFire_Cue.uasset delete mode 100644 Content/_Game/Assets/Sounds/Rifle/Equip_02_Cue.uasset create mode 100644 Content/_Game/Assets/Sounds/Rifle/Pistol_Equip.uasset delete mode 100644 Content/_Game/Assets/Sounds/Rifle/Swipe_1_Cue.uasset delete mode 100644 Content/_Game/Assets/Sounds/Rifle/sw_Foley_Jump_03_Cue.uasset delete mode 100644 Content/_Game/Assets/Sounds/Rifle/sw_Wep_AR_Equip_03_Cue.uasset delete mode 100644 Content/_Game/Assets/Sounds/Rifle/sw_Wep_Launcher_Dryfire_01_Cue.uasset create mode 100644 Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Bracket_4.uasset create mode 100644 Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_15.uasset create mode 100644 Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_15_outlined.uasset create mode 100644 Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_9.uasset create mode 100644 Content/_Game/Assets/Textures/Icons/WeaponIcons/PistolIcon.uasset create mode 100644 Content/_Game/Character/Animations/Retargeted/Reloading/Reload_Pistol.uasset create mode 100644 Content/_Game/Weapons/Meshes/Belica_Pistol.uasset diff --git a/Content/_Game/Assets/Sounds/Pistol/PistolClipInsert.uasset b/Content/_Game/Assets/Sounds/Pistol/PistolClipInsert.uasset new file mode 100644 index 00000000..27f0bd96 --- /dev/null +++ b/Content/_Game/Assets/Sounds/Pistol/PistolClipInsert.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:751de36716783fc7fd257d5c5a489fd76b49ff512fc59aa819d6f58892aedfde +size 32342 diff --git a/Content/_Game/Assets/Sounds/Pistol/PistolClipInsert_Cue.uasset b/Content/_Game/Assets/Sounds/Pistol/PistolClipInsert_Cue.uasset new file mode 100644 index 00000000..217f8479 --- /dev/null +++ b/Content/_Game/Assets/Sounds/Pistol/PistolClipInsert_Cue.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f14497ca4826d211f5f073b6e09dc54cb45add113720305c3eb1505212cc1267 +size 4236 diff --git a/Content/_Game/Assets/Sounds/Pistol/PistolClipRemove.uasset b/Content/_Game/Assets/Sounds/Pistol/PistolClipRemove.uasset new file mode 100644 index 00000000..b29fccae --- /dev/null +++ b/Content/_Game/Assets/Sounds/Pistol/PistolClipRemove.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c72ddeaca2dbcf8fddbe60cb1402745c17a2f5645891a15f3e5d096d5027501 +size 50859 diff --git a/Content/_Game/Assets/Sounds/Pistol/PistolClipRemove_Cue.uasset b/Content/_Game/Assets/Sounds/Pistol/PistolClipRemove_Cue.uasset new file mode 100644 index 00000000..622740c6 --- /dev/null +++ b/Content/_Game/Assets/Sounds/Pistol/PistolClipRemove_Cue.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:589bb10d58394e9411f353bc4922fd4b1421cd7d1d85b2f75b50620a6d82f633 +size 4236 diff --git a/Content/_Game/Assets/Sounds/Pistol/PistolFire.uasset b/Content/_Game/Assets/Sounds/Pistol/PistolFire.uasset new file mode 100644 index 00000000..0167cb83 --- /dev/null +++ b/Content/_Game/Assets/Sounds/Pistol/PistolFire.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9af07f32b5c0793ce5cd6fecda09799ea18e0bd5dc6bab78c6a325dc1ba9600c +size 195780 diff --git a/Content/_Game/Assets/Sounds/Pistol/PistolFire_Cue.uasset b/Content/_Game/Assets/Sounds/Pistol/PistolFire_Cue.uasset new file mode 100644 index 00000000..338238d9 --- /dev/null +++ b/Content/_Game/Assets/Sounds/Pistol/PistolFire_Cue.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66ab563d3610928dd7b185a9336d6c34abae2af04462583a16f266a2df913c39 +size 4248 diff --git a/Content/_Game/Assets/Sounds/Rifle/Equip_01_Cue.uasset b/Content/_Game/Assets/Sounds/Rifle/Equip_01_Cue.uasset index 3d6da0f0..def9734c 100644 --- a/Content/_Game/Assets/Sounds/Rifle/Equip_01_Cue.uasset +++ b/Content/_Game/Assets/Sounds/Rifle/Equip_01_Cue.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d9234d75f723598fb3ae1b53e6dd4444a03c3b45fb1f214b144808a91d3f023f -size 4209 +oid sha256:5fe20b20c517c798f7736fc79d88ecf4b2cda62c9699a9a6d56cd32dc9e0f0ee +size 4197 diff --git a/Content/_Game/Assets/Sounds/Rifle/Equip_02_Cue.uasset b/Content/_Game/Assets/Sounds/Rifle/Equip_02_Cue.uasset deleted file mode 100644 index 0ddbe504..00000000 --- a/Content/_Game/Assets/Sounds/Rifle/Equip_02_Cue.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:884a4b9f9a75389d2cd523cb2819bf02f75b5b2d80b215486d48ce6a147bee3b -size 1510 diff --git a/Content/_Game/Assets/Sounds/Rifle/Pistol_Equip.uasset b/Content/_Game/Assets/Sounds/Rifle/Pistol_Equip.uasset new file mode 100644 index 00000000..b60d1f18 --- /dev/null +++ b/Content/_Game/Assets/Sounds/Rifle/Pistol_Equip.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c74a1be41424bfd448f2285e82a15b08014812bf3bed4c3ceb85f3cf9a1ace57 +size 4197 diff --git a/Content/_Game/Assets/Sounds/Rifle/Swipe_1_Cue.uasset b/Content/_Game/Assets/Sounds/Rifle/Swipe_1_Cue.uasset deleted file mode 100644 index 1ba3a68c..00000000 --- a/Content/_Game/Assets/Sounds/Rifle/Swipe_1_Cue.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cdd8ed83266b1447a7459c0fc683e5c23129a5bd93384d92abca4a893618cd26 -size 1509 diff --git a/Content/_Game/Assets/Sounds/Rifle/sw_Foley_Jump_03_Cue.uasset b/Content/_Game/Assets/Sounds/Rifle/sw_Foley_Jump_03_Cue.uasset deleted file mode 100644 index 6903a8f2..00000000 --- a/Content/_Game/Assets/Sounds/Rifle/sw_Foley_Jump_03_Cue.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dea2acf1da90e2bd30f8fc692bedaf86059291cb62b77200dabbd85317841727 -size 1550 diff --git a/Content/_Game/Assets/Sounds/Rifle/sw_Wep_AR_Equip_01.uasset b/Content/_Game/Assets/Sounds/Rifle/sw_Wep_AR_Equip_01.uasset index 19460789..8acf3520 100644 --- a/Content/_Game/Assets/Sounds/Rifle/sw_Wep_AR_Equip_01.uasset +++ b/Content/_Game/Assets/Sounds/Rifle/sw_Wep_AR_Equip_01.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5a916073ddba00022ddbe0ec6f1d1029a963672e18403b28999736ec12a143f1 -size 52415 +oid sha256:37213bf65d4b3b2715a7d2d8ffb567f91588b105e778df6eec2becd3868f078a +size 52484 diff --git a/Content/_Game/Assets/Sounds/Rifle/sw_Wep_AR_Equip_03_Cue.uasset b/Content/_Game/Assets/Sounds/Rifle/sw_Wep_AR_Equip_03_Cue.uasset deleted file mode 100644 index cd238ca6..00000000 --- a/Content/_Game/Assets/Sounds/Rifle/sw_Wep_AR_Equip_03_Cue.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:08ffa3d3bcf79f5f5bb390a040514902a135b71ce70a051ec78317bf13cbe0ce -size 1556 diff --git a/Content/_Game/Assets/Sounds/Rifle/sw_Wep_Launcher_Dryfire_01_Cue.uasset b/Content/_Game/Assets/Sounds/Rifle/sw_Wep_Launcher_Dryfire_01_Cue.uasset deleted file mode 100644 index 65422671..00000000 --- a/Content/_Game/Assets/Sounds/Rifle/sw_Wep_Launcher_Dryfire_01_Cue.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dfe5e7ed83bc4f6e7ffe42c7176a1b034e91e0f0d49d8f6f8ab75f79a4e1997a -size 1608 diff --git a/Content/_Game/Assets/Textures/Crosshairs/Crosshair_Bracket_4.uasset b/Content/_Game/Assets/Textures/Crosshairs/Crosshair_Bracket_4.uasset index 9f2dc972..9f7c664d 100644 --- a/Content/_Game/Assets/Textures/Crosshairs/Crosshair_Bracket_4.uasset +++ b/Content/_Game/Assets/Textures/Crosshairs/Crosshair_Bracket_4.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8b7120b49eabe86acd097e382ce4ae6078ef92a764a0320a030f96a051790c07 -size 4876 +oid sha256:e91ef79eb02bf86eeb4c368d4c5e448931e6fde726da93671699987d6fac12cb +size 1593 diff --git a/Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_15.uasset b/Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_15.uasset index 9757f09d..ce66fafc 100644 --- a/Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_15.uasset +++ b/Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_15.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2b3b742cf63516883a23285930e3d2df9d31a978b9f6c71a647f3f67b9850b25 -size 5218 +oid sha256:522e01f39f214bdf9f0dcb4616f3937e3c5fbe3cc51ef2fed586b9997c5c9589 +size 1590 diff --git a/Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_15_outlined.uasset b/Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_15_outlined.uasset index 502d925d..ac9c3909 100644 --- a/Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_15_outlined.uasset +++ b/Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_15_outlined.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d293f9fc64981ab1ff97bd809b60d93fa8321f975fe154d53180a4187f97c625 -size 5877 +oid sha256:f37d30951cf5753352fb43243f611404558754d10451b049f8f20f897a8613b2 +size 1671 diff --git a/Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_9.uasset b/Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_9.uasset index 3f1ce652..80e27544 100644 --- a/Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_9.uasset +++ b/Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_9.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a74968bb8b9dca9d2ca5a44e307d17b7a9fd3d31ada5cbee6b98e8bd3e6d74e2 -size 5184 +oid sha256:3bcfbcfc8ffacc63ccc12ef3bd09ad190e22b2ffa86dcc5041779f1255171bd4 +size 1585 diff --git a/Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Bracket_4.uasset b/Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Bracket_4.uasset new file mode 100644 index 00000000..ff22437d --- /dev/null +++ b/Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Bracket_4.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16b8c60081fee6ffea9c27b2d8db91a4d9694f38e136798de90dba42e5854382 +size 5074 diff --git a/Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_15.uasset b/Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_15.uasset new file mode 100644 index 00000000..4c6044c5 --- /dev/null +++ b/Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_15.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9ffc774b89584fedef05633ce5ed93868e60ff3c18a43cf1e47e327273a72d6 +size 5416 diff --git a/Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_15_outlined.uasset b/Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_15_outlined.uasset new file mode 100644 index 00000000..e1304c61 --- /dev/null +++ b/Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_15_outlined.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea8248c2f22ebdc56e08a4f130253a661144e5d0f5176a3ac572a3246453a4ea +size 6084 diff --git a/Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_9.uasset b/Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_9.uasset new file mode 100644 index 00000000..9b641f78 --- /dev/null +++ b/Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_9.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:490053184aca7e3e951f65572ebf131563121a70dc38fa75b246c7337b16b758 +size 5381 diff --git a/Content/_Game/Assets/Textures/Icons/WeaponIcons/PistolIcon.uasset b/Content/_Game/Assets/Textures/Icons/WeaponIcons/PistolIcon.uasset new file mode 100644 index 00000000..245ac016 --- /dev/null +++ b/Content/_Game/Assets/Textures/Icons/WeaponIcons/PistolIcon.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea264488b6926f7234167edaf3e19d82fdd3c7d0b313fa62fbfb8a58a2931f42 +size 107643 diff --git a/Content/_Game/Character/Animations/ReloadMontage.uasset b/Content/_Game/Character/Animations/ReloadMontage.uasset index 2dc15089..55422984 100644 --- a/Content/_Game/Character/Animations/ReloadMontage.uasset +++ b/Content/_Game/Character/Animations/ReloadMontage.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c46656dada88d7c07132e55401794a0aa70b37b842969ee1a742de79b92679af -size 26335 +oid sha256:50563609c5370a1f5bfd94d1c2dd160586e43f350fb918ed91e91b7b140de25f +size 35383 diff --git a/Content/_Game/Character/Animations/Retargeted/Reloading/Reload_Pistol.uasset b/Content/_Game/Character/Animations/Retargeted/Reloading/Reload_Pistol.uasset new file mode 100644 index 00000000..96a81262 --- /dev/null +++ b/Content/_Game/Character/Animations/Retargeted/Reloading/Reload_Pistol.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0256e9e63fd450d95f7142ee1c7aa7da6b509e813161b58d72fe2ac33468b0d +size 430411 diff --git a/Content/_Game/DataTable/WeaponDataTable.uasset b/Content/_Game/DataTable/WeaponDataTable.uasset index 090201b0..cdb25ff6 100644 --- a/Content/_Game/DataTable/WeaponDataTable.uasset +++ b/Content/_Game/DataTable/WeaponDataTable.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:21e619360fc9404bc63d13e169ffe6ca5f13f99bb788d04efb0aeecc910eb1bf -size 8502 +oid sha256:9969b550cbde0d09105f9144faa61bb71f04cbe13b9e2fd0bacd89391dac4628 +size 10381 diff --git a/Content/_Game/Maps/DefaultMap.umap b/Content/_Game/Maps/DefaultMap.umap index 1f4917ee..c9e337d4 100644 --- a/Content/_Game/Maps/DefaultMap.umap +++ b/Content/_Game/Maps/DefaultMap.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f7e2b0c3fca2e14ebbc27fb35301dacfc398e8c054d2c061aeb3fb0fb4def2ef -size 120148 +oid sha256:1cd26d29daf54188a81c99974168cb6a534a20dbe5d7c0a1016f3d495a0ef438 +size 126263 diff --git a/Content/_Game/Materials/ARMaterials/M_AR_Mat.uasset b/Content/_Game/Materials/ARMaterials/M_AR_Mat.uasset index 477ffa8d..50b37656 100644 --- a/Content/_Game/Materials/ARMaterials/M_AR_Mat.uasset +++ b/Content/_Game/Materials/ARMaterials/M_AR_Mat.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fb3576b4841b6c714124ed5d2c4c1a0492be3ceb83ac31e2a8595697e7bbbea3 -size 20365 +oid sha256:d1f7ec517a123f4c12d2399d08171d9d424c6361d463e02de61e9a07b721d519 +size 17163 diff --git a/Content/_Game/Weapons/Meshes/Belica_Pistol.uasset b/Content/_Game/Weapons/Meshes/Belica_Pistol.uasset new file mode 100644 index 00000000..e1169fa7 --- /dev/null +++ b/Content/_Game/Weapons/Meshes/Belica_Pistol.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad50e6c794cca57c8c2dbb55a2f693e9f83986435c0311a8294e6ef2d3c68e57 +size 15752836 diff --git a/Source/Shooter/Weapon.cpp b/Source/Shooter/Weapon.cpp index df9cb37c..2d327bbd 100644 --- a/Source/Shooter/Weapon.cpp +++ b/Source/Shooter/Weapon.cpp @@ -94,6 +94,9 @@ void AWeapon::OnConstruction(const FTransform& Transform) case EWeaponType::EWT_AssaultRifle: WeaponDataRow = WeaponTableObject->FindRow(FName("AssaultRifle"), TEXT("")); break; + case EWeaponType::EWT_Pistol: + WeaponDataRow = WeaponTableObject->FindRow(FName("Pistol"), TEXT("")); + break; case EWeaponType::EWT_SubmachineGun: default: WeaponDataRow = WeaponTableObject->FindRow(FName("SubmachineGun"), TEXT("")); @@ -130,6 +133,12 @@ void AWeapon::OnConstruction(const FTransform& Transform) AutoFireRate = WeaponDataRow->AutoFireRate; MuzzleFlash = WeaponDataRow->MuzzleFlash; FireSound = WeaponDataRow->FireSound; + + BoneToHide = WeaponDataRow->BoneToHide; + if (BoneToHide != FName("")) + { + GetItemMesh()->HideBoneByName(BoneToHide, EPhysBodyOp::PBO_None); + } } if (GetMaterialInstance()) @@ -142,3 +151,13 @@ void AWeapon::OnConstruction(const FTransform& Transform) } } } + +void AWeapon::BeginPlay() +{ + Super::BeginPlay(); + + if (BoneToHide != FName("")) + { + GetItemMesh()->HideBoneByName(BoneToHide, EPhysBodyOp::PBO_None); + } +} diff --git a/Source/Shooter/Weapon.h b/Source/Shooter/Weapon.h index 67ab521a..bd17c0e2 100644 --- a/Source/Shooter/Weapon.h +++ b/Source/Shooter/Weapon.h @@ -84,6 +84,9 @@ struct FWeaponDataTable : public FTableRowBase UPROPERTY(EditAnywhere, BlueprintReadWrite) USoundCue* FireSound; + + UPROPERTY(EditAnywhere, BlueprintReadWrite) + FName BoneToHide; }; /** @@ -104,6 +107,8 @@ protected: virtual void OnConstruction(const FTransform& Transform) override; + virtual void BeginPlay() override; + private: FTimerHandle ThrowWeaponTimer; float ThrowWeaponTime; @@ -171,6 +176,10 @@ private: UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = DataTable, meta = (AllowPrivateAccess = "true")) USoundCue* FireSound; + /** Name of the bone to hide on the weapon mesh */ + UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = DataTable, meta = (AllowPrivateAccess = "true")) + FName BoneToHide; + public: /** Adds an impulse to the weapon */ void ThrowWeapon(); diff --git a/Source/Shooter/WeaponType.h b/Source/Shooter/WeaponType.h index f6abcd32..4857f106 100644 --- a/Source/Shooter/WeaponType.h +++ b/Source/Shooter/WeaponType.h @@ -5,6 +5,7 @@ enum class EWeaponType : uint8 { EWT_SubmachineGun UMETA(DisplayName = "SubmachineGun"), EWT_AssaultRifle UMETA(DisplayName = "AssaultRifle"), + EWT_Pistol UMETA(DisplayName = "Pistol"), EWT_MAX UMETA(DisplayName = "DefaultMax"), }; \ No newline at end of file