project settings package 可以指定非APK打包,确定资源是否发布
可以指定content下某个目录所有文件(非.uassert)都打包
ios环境下fopen打开文件需要指定路径
这么转换一下就可以了
FString ConvertToIOSPath(const FString& Filename, bool bForWrite) { FString Result = Filename; #ifdef __OBJC__ if (Result.Contains(TEXT("/OnDemandResources/"))) { return Result; } Result.ReplaceInline(TEXT("../"), TEXT("")); Result.ReplaceInline(TEXT(".."), TEXT("")); Result.ReplaceInline(FPlatformProcess::BaseDir(), TEXT("")); if (bForWrite) { static FString WritePathBase = FString([NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]) + TEXT("/"); return WritePathBase + Result; } else { // if filehostip exists in the command line, cook on the fly read path should be used FString Value; // Cache this value as the command line doesn't change... static bool bHasHostIP = FParse::Value(FCommandLine::Get(), TEXT("filehostip"), Value) || FParse::Value(FCommandLine::Get(), TEXT("streaminghostip"), Value); static bool bIsIterative = FParse::Value(FCommandLine::Get(), TEXT("iterative"), Value); if (bHasHostIP) { static FString ReadPathBase = FString([NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]) + TEXT("/"); return ReadPathBase + Result; } else if (bIsIterative) { static FString ReadPathBase = FString([NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]) + TEXT("/"); return ReadPathBase + Result.ToLower(); } else { static FString ReadPathBase = FString([[NSBundle mainBundle] bundlePath]) + TEXT("/cookeddata/"); return ReadPathBase + Result.ToLower(); } } #endif return Result; }