Unreal Engine 5
SDK를 설치 후 수행하는 작업을 안내합니다.
화면 자동 회전 기능 설정¶
화면 방향을 양방향(가로와 세로 방향 모두)으로 설정 시, 아래 설정이 필요합니다.
Android¶
Android 앱 빌드에서 화면 방향을 양방향(가로와 세로 방향 모두)으로 설정 시, 화면 자동 회전 기능이 정상 동작하려면 아래 코드 수정이 필요합니다.
- /Engine/Build/Android/Java/src/com/epicgames/unreal/GameActivity.java.template로 이동하세요.
HiveActivity.onConfigurationChaged()API를 추가하세요.@Override public void onConfigurationChanged(Configuration newConfig) { HiveActivity.onConfigurationChanged(this, newConfig); // Add super.onConfigurationChanged(newConfig); // forward the orientation boolean bPortrait = newConfig.orientation == Configuration.ORIENTATION_PORTRAIT; nativeOnConfigurationChanged(bPortrait); }
iOS¶
SDK Unreal Engine 5 iOS에서는 화면 자동 회전 관련 별도 설정이 필요하지 않습니다.
Xcode 빌드 방식 변경 (iOS)¶
SDK v4를 적용하려면, Xcode의 빌드 방식을 Legacy Build로 변경해야 합니다. 아래와 같이, 좌측 패널의 프로젝트 세팅 > 플랫폼 > Xcode 프로젝트 항목에서 최신 Xcode를 체크 해제합니다. 
HIVEAppDelegate 적용 (iOS)¶
iOS 개발 환경에서 SDK를 사용하기 위해 Swizzling을 이용해 AppDelegate를 수정합니다. 앱 시작시 초기화하는 단계에서 아래 코드를 추가해주세요.
////////////////////////////////////////////////////////////////
// IOSAppDelegate.h 헤더 추가
#if PLATFORM_IOS
#include "Runtime/ApplicationCore/Public/iOS/IOSAppDelegate.h"
#endif
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
// AppDelegate 추가코드 본문
#if PLATFORM_IOS
UIApplication * dummyApplication = [UIApplication sharedApplication];
Class clzHIVEAppDelegate = NSClassFromString(@"HIVEAppDelegate");
SEL selApplicationDidFinishLaunchingWithOptions = NSSelectorFromString(@"application:didFinishLaunchingWithOptions:");
if( clzHIVEAppDelegate != nil && [clzHIVEAppDelegate respondsToSelector:selApplicationDidFinishLaunchingWithOptions] ) {
NSMethodSignature *method = [clzHIVEAppDelegate methodSignatureForSelector:selApplicationDidFinishLaunchingWithOptions];
if (method != nil) {
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:method];
[invocation setSelector:selApplicationDidFinishLaunchingWithOptions];
[invocation setTarget:clzHIVEAppDelegate];
[invocation setArgument:(void*)&dummyApplication atIndex:2];
NSDictionary *localLaunchOptions = [IOSAppDelegate GetDelegate].launchOptions;
if( localLaunchOptions != nil ) {
[invocation setArgument:(void*)&localLaunchOptions atIndex:3];
}
[invocation invoke];
}
}
#endif
////////////////////////////////////////////////////////////////
FmallocAnsi 설정 (iOS)¶
Unreal Engine iOS와 C++ 표준 템플릿 라이브러리 호환을 위해 아래와 같이 FMallocAnsi 설정이 필요합니다. 앱 프로젝트의 {YourProject}.Target.cs파일에 다음 코드를 추가합니다.