31 lines
618 B
C++
31 lines
618 B
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#include "MusicDirector.h"
|
|
|
|
#include "MusicSubsystem.h"
|
|
|
|
AMusicDirector::AMusicDirector()
|
|
{
|
|
PrimaryActorTick.bCanEverTick = false;
|
|
}
|
|
|
|
void AMusicDirector::BeginPlay()
|
|
{
|
|
Super::BeginPlay();
|
|
|
|
UMusicSubsystem* Music = UMusicSubsystem::Get(this);
|
|
if (!Music)
|
|
{
|
|
return;
|
|
}
|
|
|
|
// La consigne d'abord : elle doit etre posee meme si cette map ne change pas
|
|
// de playlist, puisque c'est elle qui vaudra pour toutes les scenes suivantes.
|
|
Music->SetLevelChangeMode(LevelChangeMode);
|
|
|
|
if (Playlist)
|
|
{
|
|
Music->PlayPlaylist(Playlist);
|
|
}
|
|
}
|