I am trying to create a custom asset type. I have created a class based on UObject and now the factory class. These are as followed. When I try to compile I get 60 Unresolved External Symbols.
Note - This class is within a plugin, however, I tested the same code on a normal project and found the same issues.
AmmoTypeFactory.h
#pragma once
#include "Factories/Factory.h"
#include "AmmoTypeFactory.generated.h"
/**
*
*/
UCLASS()
class EXTENSIBLEWEAPONS_API UAmmoTypeFactory : public UFactory
{
GENERATED_BODY()
public:
UAmmoTypeFactory();
virtual UObject* FactoryCreateNew(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn, FName CallingContext) override;
};
**AmmoTypeFactory.cpp
**
#include "AmmoTypeFactory.h"
#include "AmmoType.h"
UAmmoTypeFactory::UAmmoTypeFactory() : Super()
{
bCreateNew = true;
bEditAfterNew = true;
SupportedClass = UAmmoType::StaticClass();
}
UObject * UAmmoTypeFactory::FactoryCreateNew(UClass * InClass, UObject * InParent, FName InName, EObjectFlags Flags, UObject * Context, FFeedbackContext * Warn, FName CallingContext)
{
auto NewObjectAsset = NewObject<UAmmoType>(InParent, InClass, InName, Flags);
return NewObjectAsset;
**}
AmmoType.h**
#pragma once
#include "CoreMinimal.h"
#include "AmmoType.generated.h"
UCLASS(Blueprintable, BlueprintType)
class UAmmoType : public UObject
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (ToolTip = ""))
bool Example = false;
};
AmmoType.cpp
#include "AmmoType.h"
Errors