mirror of
https://github.com/storytold/EventCenterPlugin.git
synced 2026-11-25 03:10:44 +01:00
58 lines
1.5 KiB
C++
58 lines
1.5 KiB
C++
#pragma once
|
|
|
|
// Unreal Core
|
|
#include "CoreMinimal.h"
|
|
#include "UObject/NoExportTypes.h"
|
|
#include "Engine/EngineTypes.h"
|
|
|
|
// EventCenterPlugin
|
|
#include "SpawnableActor.generated.h"
|
|
|
|
DECLARE_LOG_CATEGORY_EXTERN(SpawnableActorLog, Log, All);
|
|
|
|
// NB(bt): "Blueprintable" seems to remove the ability to add BP event nodes.
|
|
UCLASS()
|
|
class EVENTCENTERPLUGIN_API ASpawnableActor : public AActor
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
|
|
ASpawnableActor();
|
|
~ASpawnableActor();
|
|
|
|
/** Mesh to use */
|
|
//UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SpawnableActor", meta = (AllowPrivateAccess = "true"))
|
|
//class UStaticMeshComponent* BaseMeshComponent;
|
|
|
|
/** Mesh to use */
|
|
//UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SpawnableActor", meta = (AllowPrivateAccess = "true"))
|
|
//class UStaticMesh* BaseMesh;
|
|
|
|
// FIXME: This won't work outside of the ctor :(
|
|
//UFUNCTION(BlueprintCallable, Category = "SpawnableActor")
|
|
//void SetMeshByString(const FString& meshName);
|
|
|
|
//UFUNCTION(BlueprintCallable, Category = "SpawnableActor")
|
|
//void SetMesh(UStaticMesh* staticMesh);
|
|
|
|
/** Set a timer to destroy this actor. */
|
|
void StartDestroyTimer(float seconds);
|
|
|
|
protected:
|
|
// Called when the game starts or when spawned
|
|
virtual void BeginPlay() override;
|
|
|
|
virtual void BeginDestroy() override;
|
|
|
|
// Destroy timer callback.
|
|
void InvokeDestroy();
|
|
|
|
// (Optional) destroy callback timer.
|
|
FTimerHandle DestroyTimer;
|
|
|
|
public:
|
|
// Called every frame
|
|
virtual void Tick(float DeltaTime) override;
|
|
};
|