mirror of
https://github.com/storytold/EventCenterPlugin.git
synced 2026-10-09 00:09:42 +00:00
65 lines
1.3 KiB
C++
65 lines
1.3 KiB
C++
#include "SpawningActor.h"
|
|
|
|
#include "SpawnableActor.h"
|
|
|
|
#include "Engine/World.h"
|
|
#include "UObject/Object.h"
|
|
|
|
DEFINE_LOG_CATEGORY(SpawningActorLog);
|
|
|
|
ASpawningActor::ASpawningActor()
|
|
{
|
|
UE_LOG(EventSourceLog, Log, TEXT("CTOR()"));
|
|
|
|
// Set this actor to call Tick() every frame.
|
|
// You can turn this off to improve performance if you don't need it.
|
|
PrimaryActorTick.bCanEverTick = true;
|
|
}
|
|
|
|
ASpawningActor::~ASpawningActor()
|
|
{
|
|
}
|
|
|
|
void ASpawningActor::BeginPlay()
|
|
{
|
|
Super::BeginPlay();
|
|
}
|
|
|
|
void ASpawningActor::BeginDestroy()
|
|
{
|
|
Super::BeginDestroy();
|
|
}
|
|
|
|
void ASpawningActor::Tick(float DeltaTime)
|
|
{
|
|
Super::Tick(DeltaTime);
|
|
}
|
|
|
|
void ASpawningActor::Spawn()
|
|
{
|
|
//SpawnActor<ASpawnableActor>(this, this);
|
|
|
|
FTransform location;
|
|
FRotator rotation;
|
|
//GetWorld()->SpawnActor<ASpawnableActor>(ASpawnableActor::StaticClass(), &spawnLocation);
|
|
|
|
/*ASpawnableActor* spawnedActor = (ASpawnableActor*)GetWorld()->SpawnActor(
|
|
ASpawnableActor::StaticClass(),
|
|
NAME_None,
|
|
&location,
|
|
&rotation,
|
|
nullptr, // ??
|
|
false, // bNoCollisionFail
|
|
false, // ??
|
|
nullptr, // owner
|
|
nullptr // instigator
|
|
);*/
|
|
//ASpawnableActor* spawnedActor = (ASpawnableActor*)GetWorld()->SpawnActor<ASpawnableActor>(&spawnLocation);
|
|
ASpawnableActor* spawnedActor = (ASpawnableActor*)GetWorld()->SpawnActor(ASpawnableActor::StaticClass());
|
|
|
|
spawnedActor->SetMesh();
|
|
|
|
|
|
}
|
|
|