ConversationFactory.h:
#pragma once
#include "UnrealEd.h"
#include "CoreUObject.h"
#include "Conversation.h"
#include "ConversationFactory.generated.h"
UCLASS()
class UConversationFactory : public UFactory
{
GENERATED_UCLASS_BODY()
// UFactory interface
virtual UObject* FactoryCreateNew(UClass* Class, UObject* InParent, FName Name, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn) override;
// End of UFactory interface
};
and ConversationFactory.cpp
#include "ConversationFactory.h"
#define LOCTEXT_NAMESPACE "Conversation"
/////////////////////////////////////////////////////
// UConversationFactory
UConversationFactory::UConversationFactory(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
bCreateNew = true;
bEditAfterNew = true;
SupportedClass = UConversation::StaticClass();
}
UObject* UConversationFactory::FactoryCreateNew(UClass* Class, UObject* InParent, FName Name, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn)
{
UConversation* NewObjectAsset = ConstructObject(Class, InParent, Name, Flags | RF_Transactional);
return NewObjectAsset;
}
#undef LOCTEXT_NAMESPACE
And when I try to compile this, VS says that the identifier “ContructObject” is not defined. What am i doing wrong?