Files
EventCenterPlugin/Source/EventCenterPlugin/Public/SpawnableActor.h
T
Brandon Thomas 439968b8e7 This is an experiment (not working yet) Multiple actor classes
* Skeletal meshes
* Static meshes
* Parent class for both
2021-03-03 06:51:49 -05:00

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;
};