45 lines
887 B
C++
45 lines
887 B
C++
#pragma once
|
|
#include "LuaActorComponent.h"
|
|
#include "BusyPawnMovement.generated.h"
|
|
|
|
UINTERFACE(MinimalAPI, Blueprintable)
|
|
class UBusyMovable : public UInterface
|
|
{
|
|
GENERATED_BODY()
|
|
};
|
|
|
|
class IBusyMovable
|
|
{
|
|
GENERATED_BODY()
|
|
public:
|
|
|
|
UFUNCTION(BlueprintNativeEvent)
|
|
float GetSpeed() const;
|
|
|
|
UFUNCTION(BlueprintNativeEvent, Category = "Movement")
|
|
void UpdateMoveDirection(const FVector2D &InDirection);
|
|
|
|
};
|
|
|
|
|
|
UCLASS()
|
|
class UBusyPawnMovement : public ULuaActorComponent
|
|
{
|
|
GENERATED_BODY()
|
|
public:
|
|
UBusyPawnMovement();
|
|
|
|
public:
|
|
UFUNCTION(BlueprintCallable)
|
|
void MoveTo(const FVector2D& Target);
|
|
|
|
UFUNCTION(BlueprintCallable)
|
|
FVector2D GetMoveDirection()const;
|
|
|
|
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)override;
|
|
|
|
protected:
|
|
UPROPERTY(EditAnywhere, BlueprintReadOnly)
|
|
FVector2D MoveTargetLocation;
|
|
};
|