Section 11: Multiple Weapon Types - Lecture 211
Drawing crosshairs fom weapon variables
This commit is contained in:
parent
f7d1525e7e
commit
473271348a
BIN
Content/FPS_Weapon_Bundle/Weapons/Meshes/AR4/SK_AR4.uasset (Stored with Git LFS)
BIN
Content/FPS_Weapon_Bundle/Weapons/Meshes/AR4/SK_AR4.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/FPS_Weapon_Bundle/Weapons/Meshes/AR4/SK_AR4_Skeleton.uasset (Stored with Git LFS)
BIN
Content/FPS_Weapon_Bundle/Weapons/Meshes/AR4/SK_AR4_Skeleton.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/ParagonLtBelica/Characters/Heroes/Belica/Meshes/Belica.uasset (Stored with Git LFS)
BIN
Content/ParagonLtBelica/Characters/Heroes/Belica/Meshes/Belica.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/ParagonLtBelica/Characters/Heroes/Belica/Meshes/Belica_Skeleton.uasset (Stored with Git LFS)
BIN
Content/ParagonLtBelica/Characters/Heroes/Belica/Meshes/Belica_Skeleton.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/_Game/Ammo/Ammo9mmBP.uasset (Stored with Git LFS)
BIN
Content/_Game/Ammo/Ammo9mmBP.uasset (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
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.
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_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/Textures/CrosshairsEdited/Arrow_Bottom_Outlined.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Arrow_Bottom_Outlined.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Arrow_Left_Outlined.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Arrow_Left_Outlined.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Arrow_Right_Outlined.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Arrow_Right_Outlined.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Arrow_Top_Outlined.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Arrow_Top_Outlined.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Cross_Q_9.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Cross_Q_9.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Arrow_Bottom.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Arrow_Bottom.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Arrow_Left.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Arrow_Left.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Arrow_Right.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Arrow_Right.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Arrow_Top.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Arrow_Top.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Dot.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Dot.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Dot_Small.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Dot_Small.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Quad_9_Bottom.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Quad_9_Bottom.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Quad_9_Left.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Quad_9_Left.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Quad_9_Right.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Quad_9_Right.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Quad_9_Top.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Crosshair_Quad_9_Top.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Quad_9_Bottom.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Quad_9_Bottom.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Quad_9_Left.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Quad_9_Left.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Quad_9_Right.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Quad_9_Right.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Quad_9_Top.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Assets/Textures/CrosshairsEdited/Quad_9_Top.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_Rifle_Ironsights.uasset (Stored with Git LFS)
Normal file
BIN
Content/_Game/Character/Animations/Retargeted/Reloading/Reload_Rifle_Ironsights.uasset (Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Content/_Game/Character/ShooterAnimBP.uasset (Stored with Git LFS)
BIN
Content/_Game/Character/ShooterAnimBP.uasset (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
BIN
Content/_Game/HUD/PickupWidgetBP.uasset (Stored with Git LFS)
BIN
Content/_Game/HUD/PickupWidgetBP.uasset (Stored with Git LFS)
Binary file not shown.
BIN
Content/_Game/HUD/ShooterHUDBP.uasset (Stored with Git LFS)
BIN
Content/_Game/HUD/ShooterHUDBP.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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Content/_Game/Weapons/BaseWeapon/BaseWeaponBP.uasset (Stored with Git LFS)
BIN
Content/_Game/Weapons/BaseWeapon/BaseWeaponBP.uasset (Stored with Git LFS)
Binary file not shown.
|
@ -316,7 +316,10 @@ public:
|
||||||
FORCEINLINE USkeletalMeshComponent* GetItemMesh() const { return ItemMesh; }
|
FORCEINLINE USkeletalMeshComponent* GetItemMesh() const { return ItemMesh; }
|
||||||
|
|
||||||
FORCEINLINE USoundCue* GetPickupSound() const { return PickupSound; }
|
FORCEINLINE USoundCue* GetPickupSound() const { return PickupSound; }
|
||||||
|
FORCEINLINE void SetPickupSound(USoundCue* Sound) { PickupSound = Sound; }
|
||||||
|
|
||||||
FORCEINLINE USoundCue* GetEquipSound() const { return EquipSound; }
|
FORCEINLINE USoundCue* GetEquipSound() const { return EquipSound; }
|
||||||
|
FORCEINLINE void SetEquipSound(USoundCue* Sound) { EquipSound = Sound; }
|
||||||
|
|
||||||
FORCEINLINE int32 GetItemCount() const { return ItemCount; }
|
FORCEINLINE int32 GetItemCount() const { return ItemCount; }
|
||||||
|
|
||||||
|
@ -327,6 +330,22 @@ public:
|
||||||
|
|
||||||
FORCEINLINE void SetCharacterInventoryFull(bool bFull) { bCharacterInventoryFull = bFull; }
|
FORCEINLINE void SetCharacterInventoryFull(bool bFull) { bCharacterInventoryFull = bFull; }
|
||||||
|
|
||||||
|
FORCEINLINE void SetItemName(FString Name) { ItemName = Name; }
|
||||||
|
|
||||||
|
FORCEINLINE void SetIconItem(UTexture2D* Icon) { IconItem = Icon; }
|
||||||
|
FORCEINLINE void SetIconAmmo(UTexture2D* Icon) { IconAmmo = Icon; }
|
||||||
|
|
||||||
|
FORCEINLINE UMaterialInstance* GetMaterialInstance() const { return MaterialInstance; }
|
||||||
|
FORCEINLINE void SetMaterialInstance(UMaterialInstance* Instance) { MaterialInstance = Instance; }
|
||||||
|
|
||||||
|
FORCEINLINE UMaterialInstanceDynamic* GetDynamicMaterialInstance() const { return DynamicMaterialInstance; }
|
||||||
|
FORCEINLINE void SetDynamicMaterialInstance(UMaterialInstanceDynamic* Instance) { DynamicMaterialInstance = Instance; }
|
||||||
|
|
||||||
|
FORCEINLINE FLinearColor GetGlowColor() const { return GlowColor; }
|
||||||
|
|
||||||
|
FORCEINLINE void SetMaterialIndex(int32 Index) { MaterialIndex = Index; }
|
||||||
|
FORCEINLINE int32 GetMaterialIndex() const { return MaterialIndex; }
|
||||||
|
|
||||||
/** Called from the AShooterCharacter class */
|
/** Called from the AShooterCharacter class */
|
||||||
void StartItemCurve(AShooterCharacter* Char, bool bForcePlaySound = false);
|
void StartItemCurve(AShooterCharacter* Char, bool bForcePlaySound = false);
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
#include "ShooterCharacter.h"
|
#include "ShooterCharacter.h"
|
||||||
#include "GameFramework/CharacterMovementComponent.h"
|
#include "GameFramework/CharacterMovementComponent.h"
|
||||||
#include "Kismet/KismetMathLibrary.h"
|
#include "Kismet/KismetMathLibrary.h"
|
||||||
|
#include "Weapon.h"
|
||||||
|
#include "WeaponType.h"
|
||||||
|
|
||||||
UShooterAnimInstance::UShooterAnimInstance() :
|
UShooterAnimInstance::UShooterAnimInstance() :
|
||||||
Speed(0.f),
|
Speed(0.f),
|
||||||
|
@ -26,7 +28,9 @@ UShooterAnimInstance::UShooterAnimInstance() :
|
||||||
CharacterRotationLastFrame(FRotator(0)),
|
CharacterRotationLastFrame(FRotator(0)),
|
||||||
YawDelta(0.f),
|
YawDelta(0.f),
|
||||||
RecoilWeight(1.f),
|
RecoilWeight(1.f),
|
||||||
bTurningInPlace(false)
|
bTurningInPlace(false),
|
||||||
|
EquippedWeaponType(EWeaponType::EWT_MAX),
|
||||||
|
bShouldUseFABRIK(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,6 +67,8 @@ void UShooterAnimInstance::UpdateAnimationProperties(float DeltaTime)
|
||||||
bReloading = ShooterCharacter->GetCombatState() == ECombatState::ECS_Reloading;
|
bReloading = ShooterCharacter->GetCombatState() == ECombatState::ECS_Reloading;
|
||||||
bCrouching = ShooterCharacter->IsCrouching();
|
bCrouching = ShooterCharacter->IsCrouching();
|
||||||
bEquipping = ShooterCharacter->GetCombatState() == ECombatState::ECS_Equipping;
|
bEquipping = ShooterCharacter->GetCombatState() == ECombatState::ECS_Equipping;
|
||||||
|
bShouldUseFABRIK = ShooterCharacter->GetCombatState() == ECombatState::ECS_Unoccupied
|
||||||
|
|| ShooterCharacter->GetCombatState() == ECombatState::ECS_FireTimerInProgress;
|
||||||
|
|
||||||
if (bReloading)
|
if (bReloading)
|
||||||
{
|
{
|
||||||
|
@ -81,6 +87,12 @@ void UShooterAnimInstance::UpdateAnimationProperties(float DeltaTime)
|
||||||
OffsetState = EOffsetState::EOS_Hip;
|
OffsetState = EOffsetState::EOS_Hip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if ShooterCharacter has a valid EquippedWeapon
|
||||||
|
if (ShooterCharacter->GetEquippedWeapon())
|
||||||
|
{
|
||||||
|
EquippedWeaponType = ShooterCharacter->GetEquippedWeapon()->GetWeaponType();
|
||||||
|
}
|
||||||
|
|
||||||
TurnInPlace();
|
TurnInPlace();
|
||||||
Lean(DeltaTime);
|
Lean(DeltaTime);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Animation/AnimInstance.h"
|
#include "Animation/AnimInstance.h"
|
||||||
|
#include "WeaponType.h"
|
||||||
|
|
||||||
#include "ShooterAnimInstance.generated.h"
|
#include "ShooterAnimInstance.generated.h"
|
||||||
|
|
||||||
class AShooterCharacter;
|
class AShooterCharacter;
|
||||||
|
@ -123,4 +125,12 @@ private:
|
||||||
/** True when turning in place */
|
/** True when turning in place */
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Turn In Place", meta = (AllowPrivateAccess = true))
|
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Turn In Place", meta = (AllowPrivateAccess = true))
|
||||||
bool bTurningInPlace;
|
bool bTurningInPlace;
|
||||||
|
|
||||||
|
/** Weapon type for the currently equipped weapon */
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Combat, meta = (AllowPrivateAccess = true))
|
||||||
|
EWeaponType EquippedWeaponType;
|
||||||
|
|
||||||
|
/** True when not reloading or equipping */
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Combat, meta = (AllowPrivateAccess = true))
|
||||||
|
bool bShouldUseFABRIK;
|
||||||
};
|
};
|
||||||
|
|
|
@ -531,4 +531,6 @@ public:
|
||||||
void StartEquipSoundTimer();
|
void StartEquipSoundTimer();
|
||||||
|
|
||||||
void UnhighlightInventorySlot();
|
void UnhighlightInventorySlot();
|
||||||
|
|
||||||
|
FORCEINLINE AWeapon* GetEquippedWeapon() const { return EquippedWeapon; }
|
||||||
};
|
};
|
||||||
|
|
|
@ -78,3 +78,63 @@ void AWeapon::StopFalling()
|
||||||
SetItemState(EItemState::EIS_Pickup);
|
SetItemState(EItemState::EIS_Pickup);
|
||||||
StartPulseTimer();
|
StartPulseTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AWeapon::OnConstruction(const FTransform& Transform)
|
||||||
|
{
|
||||||
|
Super::OnConstruction(Transform);
|
||||||
|
|
||||||
|
const FString WeaponTablePath{ TEXT("/Script/Engine.DataTable'/Game/_Game/DataTable/WeaponDataTable.WeaponDataTable'") };
|
||||||
|
UDataTable* WeaponTableObject = Cast<UDataTable>(StaticLoadObject(UDataTable::StaticClass(), nullptr, *WeaponTablePath));
|
||||||
|
|
||||||
|
if (WeaponTableObject)
|
||||||
|
{
|
||||||
|
FWeaponDataTable* WeaponDataRow = nullptr;
|
||||||
|
switch (WeaponType)
|
||||||
|
{
|
||||||
|
case EWeaponType::EWT_AssaultRifle:
|
||||||
|
WeaponDataRow = WeaponTableObject->FindRow<FWeaponDataTable>(FName("AssaultRifle"), TEXT(""));
|
||||||
|
break;
|
||||||
|
case EWeaponType::EWT_SubmachineGun:
|
||||||
|
default:
|
||||||
|
WeaponDataRow = WeaponTableObject->FindRow<FWeaponDataTable>(FName("SubmachineGun"), TEXT(""));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (WeaponDataRow)
|
||||||
|
{
|
||||||
|
AmmoType = WeaponDataRow->AmmoType;
|
||||||
|
Ammo = WeaponDataRow->WeaponAmmo;
|
||||||
|
MagazineCapacity = WeaponDataRow->MagazineCapacity;
|
||||||
|
SetPickupSound(WeaponDataRow->PickupSound);
|
||||||
|
SetEquipSound(WeaponDataRow->EquipSound);
|
||||||
|
GetItemMesh()->SetSkeletalMesh(WeaponDataRow->ItemMesh);
|
||||||
|
SetItemName(WeaponDataRow->ItemName);
|
||||||
|
SetIconItem(WeaponDataRow->InventoryIcon);
|
||||||
|
SetIconAmmo(WeaponDataRow->AmmoIcon);
|
||||||
|
|
||||||
|
SetMaterialInstance(WeaponDataRow->MaterialInstance);
|
||||||
|
PreviousMaterialIndex = GetMaterialIndex();
|
||||||
|
GetItemMesh()->SetMaterial(PreviousMaterialIndex, nullptr);
|
||||||
|
SetMaterialIndex(WeaponDataRow->MaterialIndex);
|
||||||
|
|
||||||
|
ClipBoneName = WeaponDataRow->ClipBoneName;
|
||||||
|
ReloadMontageSection = WeaponDataRow->ReloadMontageSection;
|
||||||
|
|
||||||
|
GetItemMesh()->SetAnimInstanceClass(WeaponDataRow->AnimBP);
|
||||||
|
|
||||||
|
CrosshairsMiddle = WeaponDataRow->CrosshairsMiddle;
|
||||||
|
CrosshairsLeft = WeaponDataRow->CrosshairsLeft;
|
||||||
|
CrosshairsRight = WeaponDataRow->CrosshairsRight;
|
||||||
|
CrosshairsBottom = WeaponDataRow->CrosshairsBottom;
|
||||||
|
CrosshairsTop = WeaponDataRow->CrosshairsTop;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GetMaterialInstance())
|
||||||
|
{
|
||||||
|
SetDynamicMaterialInstance(UMaterialInstanceDynamic::Create(GetMaterialInstance(), this));
|
||||||
|
GetDynamicMaterialInstance()->SetVectorParameterValue(TEXT("FresnelColor"), GetGlowColor());
|
||||||
|
GetItemMesh()->SetMaterial(GetMaterialIndex(), GetDynamicMaterialInstance());
|
||||||
|
|
||||||
|
EnableGlowMaterial();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -4,19 +4,76 @@
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
#include "CoreMinimal.h"
|
||||||
#include "Item.h"
|
#include "Item.h"
|
||||||
|
|
||||||
#include "AmmoType.h"
|
#include "AmmoType.h"
|
||||||
|
#include "Engine/DataTable.h"
|
||||||
|
#include "WeaponType.h"
|
||||||
|
|
||||||
#include "Weapon.generated.h"
|
#include "Weapon.generated.h"
|
||||||
|
|
||||||
|
class USoundCue;
|
||||||
|
class UWidgetComponent;
|
||||||
|
|
||||||
UENUM(BlueprintType)
|
USTRUCT(BlueprintType)
|
||||||
enum class EWeaponType: uint8
|
struct FWeaponDataTable : public FTableRowBase
|
||||||
{
|
{
|
||||||
EWT_SubmachineGun UMETA(DisplayName = "SubmachineGun"),
|
GENERATED_BODY()
|
||||||
EWT_AssaultRifle UMETA(DisplayName = "AssaultRifle"),
|
|
||||||
|
|
||||||
EWT_MAX UMETA(DisplayName = "DefaultMax"),
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
EAmmoType AmmoType;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
int32 WeaponAmmo;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
int32 MagazineCapacity;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
USoundCue* PickupSound;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
USoundCue* EquipSound;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
USkeletalMesh* ItemMesh;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
FString ItemName;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
UTexture2D* InventoryIcon;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
UTexture2D* AmmoIcon;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
UMaterialInstance* MaterialInstance;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
int32 MaterialIndex;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
FName ClipBoneName;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
FName ReloadMontageSection;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
TSubclassOf<UAnimInstance> AnimBP;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
UTexture2D* CrosshairsMiddle;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
UTexture2D* CrosshairsLeft;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
UTexture2D* CrosshairsRight;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
UTexture2D* CrosshairsBottom;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||||
|
UTexture2D* CrosshairsTop;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,6 +92,8 @@ public:
|
||||||
protected:
|
protected:
|
||||||
void StopFalling();
|
void StopFalling();
|
||||||
|
|
||||||
|
virtual void OnConstruction(const FTransform& Transform) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FTimerHandle ThrowWeaponTimer;
|
FTimerHandle ThrowWeaponTimer;
|
||||||
float ThrowWeaponTime;
|
float ThrowWeaponTime;
|
||||||
|
@ -64,10 +123,31 @@ private:
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Weapon Properties", meta = (AllowPrivateAccess = "true"))
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Weapon Properties", meta = (AllowPrivateAccess = "true"))
|
||||||
bool bMovingClip;
|
bool bMovingClip;
|
||||||
|
|
||||||
|
|
||||||
/** FName for the clip bone */
|
/** FName for the clip bone */
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weapon Properties", meta = (AllowPrivateAccess = "true"))
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Weapon Properties", meta = (AllowPrivateAccess = "true"))
|
||||||
FName ClipBoneName;
|
FName ClipBoneName;
|
||||||
|
|
||||||
|
/** Data table for weapon properties */
|
||||||
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = DataTable, meta = (AllowPrivateAccess = "true"))
|
||||||
|
UDataTable* WeaponDataTable;
|
||||||
|
|
||||||
|
int32 PreviousMaterialIndex;
|
||||||
|
|
||||||
|
/** Textures for the weapon crosshairs */
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = DataTable, meta = (AllowPrivateAccess = "true"))
|
||||||
|
UTexture2D* CrosshairsMiddle;
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = DataTable, meta = (AllowPrivateAccess = "true"))
|
||||||
|
UTexture2D* CrosshairsLeft;
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = DataTable, meta = (AllowPrivateAccess = "true"))
|
||||||
|
UTexture2D* CrosshairsRight;
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = DataTable, meta = (AllowPrivateAccess = "true"))
|
||||||
|
UTexture2D* CrosshairsBottom;
|
||||||
|
|
||||||
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = DataTable, meta = (AllowPrivateAccess = "true"))
|
||||||
|
UTexture2D* CrosshairsTop;
|
||||||
public:
|
public:
|
||||||
/** Adds an impulse to the weapon */
|
/** Adds an impulse to the weapon */
|
||||||
void ThrowWeapon();
|
void ThrowWeapon();
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
UENUM(BlueprintType)
|
||||||
|
enum class EWeaponType : uint8
|
||||||
|
{
|
||||||
|
EWT_SubmachineGun UMETA(DisplayName = "SubmachineGun"),
|
||||||
|
EWT_AssaultRifle UMETA(DisplayName = "AssaultRifle"),
|
||||||
|
|
||||||
|
EWT_MAX UMETA(DisplayName = "DefaultMax"),
|
||||||
|
};
|
Loading…
Reference in New Issue