RealtimeStyleTransferRuntime/Source/LyraGame/GameFeatures/GameFeatureAction_StyleTran...

26 lines
807 B
C++
Raw Normal View History

#include "GameFeatureAction_StyleTransfer.h"
#include "StyleTransferSubsystem.h"
void UGameFeatureAction_StyleTransfer::OnGameFeatureActivating(FGameFeatureActivatingContext& Context)
{
Super::OnGameFeatureActivating(Context);
}
void UGameFeatureAction_StyleTransfer::OnGameFeatureDeactivating(FGameFeatureDeactivatingContext& Context)
{
Super::OnGameFeatureDeactivating(Context);
// @todo shutdown cleanly
}
void UGameFeatureAction_StyleTransfer::AddToWorld(const FWorldContext& WorldContext, const FGameFeatureStateChangeContext& ChangeContext)
{
auto* StyleTransferSubsystem = WorldContext.OwningGameInstance->GetSubsystem<UStyleTransferSubsystem>();
UGameViewportClient* GameViewportClient = WorldContext.GameViewport;
StyleTransferSubsystem->StartStylizingViewport(GameViewportClient);
}