UE5移动端主要对象生命周期及监听
1、GameInstance
1、首先加载GameInstance,全局唯一,切换Map也是唯一的,用于做一些全局操作,比如监听Map加载,监听App进入前台、退出后台
// Fill out your copyright notice in the Description page of Project Settings.
#include "Core/Base/MyGameInstance.h"
#include "Core/Config/GameConfig.h"
#include "Core/Util/TimeUtil.h"
#include "Global/GlobalManager.h"
#include "Kismet/KismetSystemLibrary.h"
#include "Misc/Base64.h"
UMyGameInstance::UMyGameInstance(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer) {
}
void UMyGameInstance::Init() {
Super::Init();
#if WITH_EDITOR
GAllowActorScriptExecutionInEditor = true;
ResizeViewPort(1080, 1920);
#endif
if (GameConfig::IS_PAK
原文地址:https://blog.csdn.net/tangfuling1991/article/details/143438060
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!