首页 > 移动平台 > 详细

ue4 ios

时间:2017-01-07 01:10:18      阅读:347      评论:0      收藏:0      [点我收藏+]

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;
    }

 

ue4 ios

原文:http://www.cnblogs.com/wanliyun/p/6258054.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!