Is it possible to implement UFactory in Runtime plugin?

I want to create texture asset in runtime engine plugin. is this possible to implement UFactory in runtime type plugin.
This works fine with editor build but for stand alone build it gives build errors for code under macro WITH_EDITOR.
As I’ve to include UnrealEd module in my plugin.cs, so it causing build error when I try to package my game with runtime plugin. Pls suggest me the way out so that I can have Ufactory implementation in my runtime plugin and it should work in standalone game as well.

Build script is C# and UBT forwards build configuration to it so you can add conditional configuration, so script will add decencies only if specific build configuration is used, so add something like this:

if (UEBuildConfiguration.bBuildEditor)
{
		PrivateDependencyModuleNames.Add("UnrealEd");
}

I’ve added this in my cs file and also guarded UFactory and related code under WITH_EDITOR macro but I still get below mentioned build error.

UnrealBuildTool: Error: Couldn’t find parent type for ‘MyTextureFactory’ named ‘UFactory’ in current module or any other module parsed so far.*

this error can be fixed by commenting UCLASS() in MyTextureFactory.h
although whole code in this file is under macro WITH_EDITOR.

Hello, Rahul3349
Were you able to get project packaged with UFactory? Currently I’m having same problem and have no idea what to do with it.

UnrealBuildTool: Error: Couldn't find parent type for 'CustomAssetFactory' named 'UFactory' in current module or any other module parsed so far.

All runtime stuff is packed in

if (UEBuildConfiguration.bBuildEditor)

but it doesn’t change anything.