LEAP Documentation 40220
Documentation for the LEAP project
AnimNotify_Footstep.h
Go to the documentation of this file.
1// Copyright Blue Isle Studios Inc 2018. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Engine/DataTable.h"
7#include "Animation/AnimNotifies/AnimNotify.h"
8#include "AnimNotify_Footstep.generated.h"
9
10class USoundBase;
11
12UENUM(BlueprintType)
13enum class EFootstepType : uint8
14{
15 Default = 0,
16 Walk = 1,
17 Run = 2,
18 Land = 3,
19 Crouch = 4
20};
21
22USTRUCT(Blueprintable)
23struct FFootstepsTableRow : public FTableRowBase
24{
25 GENERATED_USTRUCT_BODY()
26
27 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Footstep Sounds")
28 USoundBase* DefaultSound;
29 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Footstep Sounds")
30 USoundBase* Run;
31 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Footstep Sounds")
32 USoundBase* Walk;
33 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Footstep Sounds")
34 USoundBase* Land;
35 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Footstep Sounds")
36 USoundBase* Crouch;
37 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Footstep Sounds")
38 UParticleSystem* DefaultParticles;
39 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Footstep Sounds")
40 UParticleSystem* RunParticles;
41 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Footstep Sounds")
42 UParticleSystem* WalkParticles;
43 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Footstep Sounds")
44 UParticleSystem* LandParticles;
45 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Footstep Sounds")
46 UParticleSystem* CrouchParticles;
47 UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Footstep Sounds")
48 UMaterialInterface* FootstepDecal = NULL;
49};
50
51UCLASS()
52class PROJECTX_API UAnimNotify_Footstep : public UAnimNotify
53{
54 GENERATED_BODY()
55
56public:
57 // Socket or bone name to play sound on
58 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AnimNotify", meta = (EditCondition = "bFollow", ExposeOnSpawn = true))
59 FName AttachName = NAME_None;
60 // Type of footstep to play
61 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AnimNotify", meta = (EditCondition = "bFollow", ExposeOnSpawn = true))
62 EFootstepType FootstepType;
63 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AnimNotify")
64 float MaxDrawDistance = 10000.0f;
65
66 static void Footstep(class USkeletalMeshComponent* MeshComp, EFootstepType FootstepType, FName AttachSocket = NAME_None, float MaxDrawDistance = 10000.0f);
67
68private:
69 virtual void Notify(class USkeletalMeshComponent* MeshComp, class UAnimSequenceBase* Animation) override;
70 static void PlayEffectAtLocation(const FFootstepsTableRow* FootstepRow, const FVector Location, const class USkeletalMeshComponent* MeshComp, EFootstepType FootstepType, float MaxDrawDistance);
71};
EFootstepType
Definition: AnimNotify_Footstep.h:14
Definition: AnimNotify_Footstep.h:53
Definition: AnimNotify_Footstep.h:24