LEAP Documentation 40220
Documentation for the LEAP project
JetPackComponent.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"
8#include "JetPackComponent.generated.h"
9
11
12DECLARE_DYNAMIC_MULTICAST_DELEGATE(FJetPackUpdateSignature);
13
14UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent), Blueprintable )
15class PROJECTX_API UJetPackComponent : public UActorComponent
16{
17 GENERATED_UCLASS_BODY()
18
19protected:
20 virtual void BeginPlay() override;
21 virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
22
23 virtual void SetJetPack(bool bEnable);
24
25 UFUNCTION()
26 virtual void OnRep_JetPackEnabled();
27 UFUNCTION()
28 virtual void CheckCustomMovementToggle(ECustomMovementType CustomMovementType, bool bToggledState);
29
30public:
31 virtual void StartJetPack();
32 virtual void StopJetPack();
33 UFUNCTION()
34 FORCEINLINE bool IsEnabled() const { return bJetPackEnabled; }
35
36 virtual void SetupPlayerInputComponent();
37
38public:
39 UPROPERTY(BlueprintAssignable)
40 FJetPackUpdateSignature OnJetPackStart;
41 UPROPERTY(BlueprintAssignable)
42 FJetPackUpdateSignature OnJetPackStop;
43
44protected:
45 UPROPERTY()
46 AProjectXCharacter* CharacterOwner = NULL;
47
48 UPROPERTY(ReplicatedUsing = OnRep_JetPackEnabled)
49 bool bJetPackEnabled = false;
50
51 bool bWasJetPackEnabled = false;
52};
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FJetPackUpdateSignature)
ECustomMovementType
Definition: PlayerStructs.h:15
Definition: ProjectXCharacter.h:128