UE4 设置计时器

 

#include "TimerManager.h"

 

if (!GEngine) return;
if (!GEngine->GameViewport) return;
UWorld* World = GEngine->GameViewport->GetWorld();
if (!World) return;
World->GetTimerManager().SetTimer(FinishedHandle, this, &UHMMusicNoteManager::Finish, 10.f);

如果在单例中写的话,getworld()是空的

posted @ 2020-04-08 14:30  小喜蛋7  阅读(1045)  评论(0编辑  收藏  举报