43 lines
1.4 KiB
C++
43 lines
1.4 KiB
C++
// Copyright 2016 Mookie. All Rights Reserved.
|
|
|
|
#include "EBBulletActorFactory.h"
|
|
#include "EBBullet.h"
|
|
#include "AssetToolsModule.h"
|
|
#include "Engine/World.h"
|
|
|
|
#define LOCTEXT_NAMESPACE "EBBulletActorFactory"
|
|
|
|
UEBBulletActorFactory::UEBBulletActorFactory()
|
|
{
|
|
DisplayName = LOCTEXT("EBBulletActorDisplayName", "Bullet Actor");
|
|
NewActorClass = AEBBullet::StaticClass();
|
|
bUseSurfaceOrientation = true;
|
|
}
|
|
|
|
bool UEBBulletActorFactory::CanCreateActorFrom(const FAssetData& AssetData, FText& OutErrorMsg)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
AActor* UEBBulletActorFactory::SpawnActor(UObject* InAsset, ULevel* InLevel, const FTransform& InTransform, const FActorSpawnParameters& InSpawnParams)
|
|
{
|
|
return InLevel->OwningWorld->SpawnActor<AEBBullet>(NewActorClass, InTransform, InSpawnParams);
|
|
}
|
|
|
|
UClass* FEBBulletActorFactory::GetSupportedClass() const
|
|
{
|
|
return AEBBullet::StaticClass();
|
|
}
|
|
|
|
uint32 FEBBulletActorFactory::GetCategories()
|
|
{
|
|
IAssetTools& AssetTools = FModuleManager::LoadModuleChecked<FAssetToolsModule>("AssetTools").Get();
|
|
return AssetTools.RegisterAdvancedAssetCategory(FName(TEXT("Ballistics")), LOCTEXT("BallisticsCategory", "Ballistics"));
|
|
}
|
|
|
|
FText FEBBulletActorFactory::GetAssetDescription(const FAssetData& AssetData) const
|
|
{
|
|
return LOCTEXT("EBBulletActorDescription", "A ballistic projectile actor with realistic physics simulation including drag, atmospheric effects, penetration, and ricochets.");
|
|
}
|
|
|
|
#undef LOCTEXT_NAMESPACE |