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
14
15
16UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
17class CK_UE_API UProjectilePilotComponent : public UActorComponent
18{
19 GENERATED_BODY()
20
21public:
22 UProjectilePilotComponent();
23
24public:
25 UFUNCTION(BlueprintCallable, Category = "Projectile|Pilot")
26 void Pilot(const FVector& InStart, const FVector& InDirectionOrTarget);
27
28 UFUNCTION(BlueprintCallable, Category = "Projectile|Pilot")
29 void Stop();
30
31 void ResetFlight();
32
33public:
34 UFUNCTION(BlueprintPure, Category = "Projectile|Pilot")
35 FORCEINLINE FVector GetVelocity() const
36 {
37 return MovementMode ? MovementMode->GetCurrentVelocity() : FVector::ZeroVector;
38 }
39
40 UFUNCTION(BlueprintPure, Category = "Projectile|Pilot")
41 FORCEINLINE bool IsFlying() const
42 {
43 return bFlying;
44 }
45
46 FORCEINLINE float GetExpectedTravelDuration() const
47 {
48 return IsValid(MovementMode) ? MovementMode->GetProjectileDuration() : 0.0f;
49 }
50
51protected:
52 virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
53
54private:
55 void BeginFlight(const FVector& InStart, const FVector& InDirectionOrTarget);
56
57
58public:
59 UPROPERTY(BlueprintAssignable, Category = "Projectile|Pilot")
60 FOnProjectileArrived OnArrived;
61
62 UPROPERTY(EditAnywhere, Instanced, Category = "Projectile|Pilot")
63 TObjectPtr<UProjectileMovementBase> MovementMode;
64
65private:
66 bool bFlying = false;
67};
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnProjectileArrived)
Definition ProjectileMovementBase.h:12