Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
ProjectilePilotComponent.h
이 파일의 문서화 페이지로 가기
1// Fill out your copyright notice in the Description page of Project Settings.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Components/ActorComponent.h"
8#include "ProjectilePilotComponent.generated.h"
9
11
12
14DECLARE_MULTICAST_DELEGATE_OneParam(FOnProjectileFlightProgress, float);
15
16
17UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
18class CK_UE_API UProjectilePilotComponent : public UActorComponent
19{
20 GENERATED_BODY()
21
22public:
24
25public:
26 UFUNCTION(BlueprintCallable, Category = "Projectile|Pilot")
27 void Pilot(const FVector& InStart, const FVector& InDirectionOrTarget);
28
29 UFUNCTION(BlueprintCallable, Category = "Projectile|Pilot")
30 void Stop();
31
32 void ResetFlight();
33
34public:
35 UFUNCTION(BlueprintPure, Category = "Projectile|Pilot")
36 FORCEINLINE FVector GetVelocity() const
37 {
38 return MovementMode ? MovementMode->GetCurrentVelocity() : FVector::ZeroVector;
39 }
40
41 UFUNCTION(BlueprintPure, Category = "Projectile|Pilot")
42 FORCEINLINE bool IsFlying() const
43 {
44 return bFlying;
45 }
46
47 FORCEINLINE float GetExpectedTravelDuration() const
48 {
49 return IsValid(MovementMode) ? MovementMode->GetProjectileDuration() : 0.0f;
50 }
51
52protected:
53 virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
54
55private:
56 void BeginFlight(const FVector& InStart, const FVector& InDirectionOrTarget);
57
58
59public:
61 FOnProjectileFlightProgress OnFlightProgress;
62
63 UPROPERTY(BlueprintAssignable, Category = "Projectile|Pilot")
64 FOnProjectileArrived OnArrived;
65
66 UPROPERTY(EditAnywhere, Instanced, Category = "Projectile|Pilot")
67 TObjectPtr<UProjectileMovementBase> MovementMode;
68
69private:
70 bool bFlying = false;
71};
DECLARE_MULTICAST_DELEGATE_OneParam(FOnProjectileFlightProgress, float)
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnProjectileArrived)
Definition ProjectileMovementBase.h:12
Definition ProjectilePilotComponent.h:19
FOnProjectileFlightProgress OnFlightProgress
Definition ProjectilePilotComponent.h:61
FORCEINLINE float GetExpectedTravelDuration() const
Definition ProjectilePilotComponent.h:47