Custom Asset types commonly have special functions you wish to be able to perform on them. For example, converting images to sprites is an option you wouldn't want to add to any other Asset type. You can create custom context menu entries for specific Asset types in order to make those functions accessible to users.
Create a new class based on
FAssetTypeActions_Base
. You'll need to includeAssetTypeActions_Base.h
in the header file.Override the following virtual functions in the class:
virtual bool HasActions(const TArray<UObject*>& InObjects) const override; virtual void GetActions(const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder) override; virtual FText GetName() const override; virtual UClass* GetSupportedClass() const override; virtual FColor GetTypeColor() const override; virtual uint32 GetCategories() override;
Declare the following function:
void MyCustomAssetContext_Clicked();