iOS ゲームに Unreal Engine 4 を使い始めました。HUD の一部として UIKit を使用しようとしています。プロファイル ビルドを実行すると、「シェル スクリプト呼び出しエラー 'UIKit/UIAlertView.h' ファイルが見つかりません」というエラーで失敗します。
私の HUD クラス .h ファイルは次のようになります。
#pragma once
#include "GameFramework/HUD.h"
#include "BasicHUD.generated.h"
UCLASS()
class ABasicHUD : public AHUD
{
GENERATED_UCLASS_BODY()
UFUNCTION(BlueprintCallable , Category="Custom")
void ShowAlert();
};
私の HUD クラス .cpp ファイルは次のようになります。
#include "MyProject2.h"
#include "BasicHUD.h"
#import <UIKit/UIAlertView.h> // Error here: "Shell Script Invocation Error 'UIKit/UIAlertView.h' file not found"
ABasicHUD::ABasicHUD(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
}
void ABasicHUD::ShowAlert(){
NSString *string = [[NSString alloc]init];
UIAlertView *alert = [[UIAlertView alloc]init];
}
私のbuild.csファイルは次のようになります。
using UnrealBuildTool;
public class MyProject2 : ModuleRules
{
public MyProject2(TargetInfo Target)
{
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
if (Target.Platform == UnrealTargetPlatform.IOS)
{
PublicIncludePaths.AddRange(new string[] {"Runtime/Core/Public/Apple", "Runtime/Core/Public/IOS"});
AddThirdPartyPrivateStaticDependencies(Target, "zlib" );
PublicFrameworks.AddRange(new string[] { "UIKit", "Foundation", "AudioToolbox", "AVFoundation", "GameKit", "StoreKit", "CoreVideo", "CoreMedia", "CoreMotion"});
bool bSupportAdvertising = true;
if (bSupportAdvertising)
{
PublicFrameworks.AddRange(new string[] { "iAD", "CoreGraphics" });
}
}
}
}
build.cs ファイルで何か間違ったことをしているに違いないと思いますが、フレームワークが見つからない理由がわかりません。unreal ビルド ツールで UIKit を見つけるにはどうすればよいですか?