UE4 Android相对路径转绝对路径方法笔记

  在windows端用FPaths::ConvertRelativePathToFull可以将相对路径转成绝对路径.

  在Andoird端,就麻烦些。可模仿UE4源码中AndroidFile.Cpp转换相对路径的方式编写自己的转换函数。

  例子:https://answers.unrealengine.com/questions/498328/androidconvertrelativepathtofull-didnt-work.html

FString ACpp_DesignPawn::GetAndroidFileBasePath()
{
#if PLATFORM_ANDROID
	extern FString GFilePathBase;
	return GFilePathBase + FString("/UE4Game/") + FApp::GetGameName() + FString("/");
#else
	return FString("");
#endif
}

  

原文地址:https://www.cnblogs.com/linqing/p/6206456.html