40 lines
1.0 KiB
C++
40 lines
1.0 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "ExplosiveActor.h"
|
|
#include "Throwable.generated.h"
|
|
|
|
UCLASS()
|
|
class NAKATOMI_API AThrowable : public AExplosiveActor
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, meta = (ClampMin = "0.0"))
|
|
float ImpulseForce = 10000.f;
|
|
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, meta = (ClampMin = "0.0", ClampMax = "1.0"))
|
|
float ImpulseAngle = 0.5f;
|
|
|
|
protected:
|
|
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
|
USphereComponent* SphereComponent;
|
|
|
|
public:
|
|
// Sets default values for this actor's properties
|
|
AThrowable();
|
|
|
|
protected:
|
|
// Called when the game starts or when spawned
|
|
virtual void BeginPlay() override;
|
|
|
|
public:
|
|
UFUNCTION()
|
|
virtual void OnOverlapBegin(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp,
|
|
FVector NormalImpulse, const FHitResult& Hit);
|
|
|
|
USphereComponent* GetSphereComponent() const { return SphereComponent; }
|
|
};
|