You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Before: 3648 unity files Total CPU Time: 47886.140625 s Total time in Parallel executor: 498.81 seconds After: 3548 unity files Total CPU Time: 46643.828125 s Total time in Parallel executor: 486.06 seconds #jira #preflight [CL 22173263 by marc audy in ue5-main branch]
52 lines
1.0 KiB
C++
52 lines
1.0 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "MediaComponent.h"
|
|
#include "MediaPlayer.h"
|
|
#include "MediaTexture.h"
|
|
#include "IMediaEventSink.h"
|
|
|
|
#include UE_INLINE_GENERATED_CPP_BY_NAME(MediaComponent)
|
|
|
|
UMediaComponent::UMediaComponent(const FObjectInitializer& ObjectInitializer)
|
|
: Super(ObjectInitializer)
|
|
{
|
|
PrimaryComponentTick.bCanEverTick = true;
|
|
bAutoActivate = true;
|
|
|
|
if (!HasAnyFlags(RF_ClassDefaultObject))
|
|
{
|
|
MediaPlayer = NewObject<UMediaPlayer>(this, "MediaPlayer", RF_Transient);
|
|
MediaPlayer->SetLooping(false);
|
|
MediaPlayer->PlayOnOpen = false;
|
|
|
|
MediaTexture = NewObject<UMediaTexture>(this, "MediaTexture", RF_Transient);
|
|
}
|
|
}
|
|
|
|
|
|
UMediaPlayer* UMediaComponent::GetMediaPlayer() const
|
|
{
|
|
return MediaPlayer;
|
|
}
|
|
|
|
|
|
UMediaTexture* UMediaComponent::GetMediaTexture() const
|
|
{
|
|
return MediaTexture;
|
|
}
|
|
|
|
void UMediaComponent::OnRegister()
|
|
{
|
|
Super::OnRegister();
|
|
|
|
if (MediaPlayer)
|
|
{
|
|
if (MediaTexture)
|
|
{
|
|
MediaTexture->SetMediaPlayer(MediaPlayer);
|
|
MediaTexture->UpdateResource();
|
|
}
|
|
}
|
|
}
|
|
|