Section 11: Multiple Weapon Types - Lecture 219
Pistol reload animation
This commit is contained in:
parent
d2221d2334
commit
d16ac0cef1
Binary file not shown.
BIN
Content/_Game/Assets/Sounds/Pistol/PistolClipInsert_Cue.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Sounds/Pistol/PistolClipInsert_Cue.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
Binary file not shown.
BIN
Content/_Game/Assets/Sounds/Pistol/PistolClipRemove_Cue.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Sounds/Pistol/PistolClipRemove_Cue.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Content/_Game/Assets/Sounds/Rifle/Equip_01_Cue.uasset (Stored with Git LFS)
BIN
Content/_Game/Assets/Sounds/Rifle/Equip_01_Cue.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/_Game/Assets/Sounds/Rifle/Equip_02_Cue.uasset (Stored with Git LFS)
BIN
Content/_Game/Assets/Sounds/Rifle/Equip_02_Cue.uasset (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
BIN
Content/_Game/Assets/Sounds/Rifle/Swipe_1_Cue.uasset (Stored with Git LFS)
BIN
Content/_Game/Assets/Sounds/Rifle/Swipe_1_Cue.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/_Game/Assets/Sounds/Rifle/sw_Foley_Jump_03_Cue.uasset (Stored with Git LFS)
BIN
Content/_Game/Assets/Sounds/Rifle/sw_Foley_Jump_03_Cue.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/_Game/Assets/Sounds/Rifle/sw_Wep_AR_Equip_01.uasset (Stored with Git LFS)
BIN
Content/_Game/Assets/Sounds/Rifle/sw_Wep_AR_Equip_01.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/_Game/Assets/Sounds/Rifle/sw_Wep_AR_Equip_03_Cue.uasset (Stored with Git LFS)
BIN
Content/_Game/Assets/Sounds/Rifle/sw_Wep_AR_Equip_03_Cue.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/_Game/Assets/Sounds/Rifle/sw_Wep_Launcher_Dryfire_01_Cue.uasset (Stored with Git LFS)
BIN
Content/_Game/Assets/Sounds/Rifle/sw_Wep_Launcher_Dryfire_01_Cue.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/_Game/Assets/Textures/Crosshairs/Crosshair_Bracket_4.uasset (Stored with Git LFS)
BIN
Content/_Game/Assets/Textures/Crosshairs/Crosshair_Bracket_4.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_15.uasset (Stored with Git LFS)
BIN
Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_15.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_15_outlined.uasset (Stored with Git LFS)
BIN
Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_15_outlined.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_9.uasset (Stored with Git LFS)
BIN
Content/_Game/Assets/Textures/Crosshairs/Crosshair_Circle_9.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Bracket_4.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Bracket_4.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_15.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_15.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_15_outlined.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_15_outlined.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_9.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Circle_9.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/Icons/WeaponIcons/PistolIcon.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/Icons/WeaponIcons/PistolIcon.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Character/Animations/ReloadMontage.uasset (Stored with Git LFS)
BIN
Content/_Game/Character/Animations/ReloadMontage.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/_Game/Character/Animations/Retargeted/Reloading/Reload_Pistol.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Character/Animations/Retargeted/Reloading/Reload_Pistol.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/DataTable/WeaponDataTable.uasset (Stored with Git LFS)
BIN
Content/_Game/DataTable/WeaponDataTable.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/_Game/Maps/DefaultMap.umap (Stored with Git LFS)
BIN
Content/_Game/Maps/DefaultMap.umap (Stored with Git LFS)
Binary file not shown.
BIN
Content/_Game/Materials/ARMaterials/M_AR_Mat.uasset (Stored with Git LFS)
BIN
Content/_Game/Materials/ARMaterials/M_AR_Mat.uasset (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
|
@ -94,6 +94,9 @@ void AWeapon::OnConstruction(const FTransform& Transform)
|
||||||
case EWeaponType::EWT_AssaultRifle:
|
case EWeaponType::EWT_AssaultRifle:
|
||||||
WeaponDataRow = WeaponTableObject->FindRow<FWeaponDataTable>(FName("AssaultRifle"), TEXT(""));
|
WeaponDataRow = WeaponTableObject->FindRow<FWeaponDataTable>(FName("AssaultRifle"), TEXT(""));
|
||||||
break;
|
break;
|
||||||
|
case EWeaponType::EWT_Pistol:
|
||||||
|
WeaponDataRow = WeaponTableObject->FindRow<FWeaponDataTable>(FName("Pistol"), TEXT(""));
|
||||||
|
break;
|
||||||
case EWeaponType::EWT_SubmachineGun:
|
case EWeaponType::EWT_SubmachineGun:
|
||||||
default:
|
default:
|
||||||
WeaponDataRow = WeaponTableObject->FindRow<FWeaponDataTable>(FName("SubmachineGun"), TEXT(""));
|
WeaponDataRow = WeaponTableObject->FindRow<FWeaponDataTable>(FName("SubmachineGun"), TEXT(""));
|
||||||
|
@ -130,6 +133,12 @@ void AWeapon::OnConstruction(const FTransform& Transform)
|
||||||
AutoFireRate = WeaponDataRow->AutoFireRate;
|
AutoFireRate = WeaponDataRow->AutoFireRate;
|
||||||
MuzzleFlash = WeaponDataRow->MuzzleFlash;
|
MuzzleFlash = WeaponDataRow->MuzzleFlash;
|
||||||
FireSound = WeaponDataRow->FireSound;
|
FireSound = WeaponDataRow->FireSound;
|
||||||
|
|
||||||
|
BoneToHide = WeaponDataRow->BoneToHide;
|
||||||
|
if (BoneToHide != FName(""))
|
||||||
|
{
|
||||||
|
GetItemMesh()->HideBoneByName(BoneToHide, EPhysBodyOp::PBO_None);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetMaterialInstance())
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -84,6 +84,9 @@ struct FWeaponDataTable : public FTableRowBase
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
USoundCue* FireSound;
|
USoundCue* FireSound;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
FName BoneToHide;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -104,6 +107,8 @@ protected:
|
||||||
|
|
||||||
virtual void OnConstruction(const FTransform& Transform) override;
|
virtual void OnConstruction(const FTransform& Transform) override;
|
||||||
|
|
||||||
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FTimerHandle ThrowWeaponTimer;
|
FTimerHandle ThrowWeaponTimer;
|
||||||
float ThrowWeaponTime;
|
float ThrowWeaponTime;
|
||||||
|
@ -171,6 +176,10 @@ private:
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = DataTable, meta = (AllowPrivateAccess = "true"))
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = DataTable, meta = (AllowPrivateAccess = "true"))
|
||||||
USoundCue* FireSound;
|
USoundCue* FireSound;
|
||||||
|
|
||||||
|
/** Name of the bone to hide on the weapon mesh */
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = DataTable, meta = (AllowPrivateAccess = "true"))
|
||||||
|
FName BoneToHide;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Adds an impulse to the weapon */
|
/** Adds an impulse to the weapon */
|
||||||
void ThrowWeapon();
|
void ThrowWeapon();
|
||||||
|
|
|
@ -5,6 +5,7 @@ enum class EWeaponType : uint8
|
||||||
{
|
{
|
||||||
EWT_SubmachineGun UMETA(DisplayName = "SubmachineGun"),
|
EWT_SubmachineGun UMETA(DisplayName = "SubmachineGun"),
|
||||||
EWT_AssaultRifle UMETA(DisplayName = "AssaultRifle"),
|
EWT_AssaultRifle UMETA(DisplayName = "AssaultRifle"),
|
||||||
|
EWT_Pistol UMETA(DisplayName = "Pistol"),
|
||||||
|
|
||||||
EWT_MAX UMETA(DisplayName = "DefaultMax"),
|
EWT_MAX UMETA(DisplayName = "DefaultMax"),
|
||||||
};
|
};
|
Loading…
Reference in New Issue