mirror of
https://github.com/storytold/ActorSpawningPlugin.git
synced 2026-11-20 17:10:44 +01:00
52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
#pragma once
|
|
|
|
// Unreal Core
|
|
#include "CoreMinimal.h"
|
|
#include "UObject/NoExportTypes.h"
|
|
|
|
// EventCenterPlugin
|
|
#include "SoundSpawnActor.h"
|
|
#include "SpawnableActor.h"
|
|
#include "SpawnableSkeletalMeshActor.h"
|
|
#include "SpawnableStaticMeshActor.h"
|
|
#include "SpawningActor.generated.h"
|
|
|
|
DECLARE_LOG_CATEGORY_EXTERN(SpawningActorLog, Log, All);
|
|
|
|
// NB(bt): "Blueprintable" seems to remove the ability to add BP event nodes.
|
|
UCLASS()
|
|
class ACTORSPAWNINGPLUGIN_API ASpawningActor : public AActor
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
|
|
ASpawningActor();
|
|
~ASpawningActor();
|
|
|
|
/** Create static mesh actor. */
|
|
UFUNCTION(BlueprintCallable, Category = "SpawningActor")
|
|
ASpawnableStaticMeshActor* SpawnStaticMeshActor();
|
|
|
|
/** Create skeletal mesh actor. */
|
|
UFUNCTION(BlueprintCallable, Category = "SpawningActor")
|
|
ASpawnableSkeletalMeshActor* SpawnSkeletalMeshActor();
|
|
|
|
/** Create sound actor. */
|
|
UFUNCTION(BlueprintCallable, Category = "SpawningActor")
|
|
ASoundSpawnActor* SpawnSoundActor(USoundBase* sound);
|
|
|
|
/** Mesh to use */
|
|
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "SpawningActor", meta = (AllowPrivateAccess = "true"))
|
|
class UStaticMeshComponent* BaseMesh;
|
|
|
|
protected:
|
|
// Called when the game starts or when spawned
|
|
virtual void BeginPlay() override;
|
|
|
|
virtual void BeginDestroy() override;
|
|
|
|
// Lookup the player's location.
|
|
FVector LookupPlayerLocation();
|
|
};
|