I need to access the game’s location on the user’s hard drive to do important setup for my game. Unity has a built in command " Application.dataPath" for accessing the location of the exe on the end user’s hard drive. Does the Flax Engine have something comparable?
Globals.ProjectFolder
should do the work.
1 Like
Thank you that worked
Like Unity’s dataPath / persistentDataPath Flax has some internal path aliases:
public static string StartupFolder => Internal_GetStartupFolder();
// Temporary folder path.
public static string TemporaryFolder => Internal_GetTemporaryFolder();
// Directory that contains project
public static string ProjectFolder => Internal_GetProjectFolder();
// The product local data directory.
public static string ProductLocalFolder => Internal_GetProductLocalFolder();
// The game executable files location.
public static string BinariesFolder => Internal_GetBinariesFolder();
// Project specific cache folder path (editor-only).
public static string ProjectCacheFolder => Internal_GetProjectCacheFolder();
// Engine content directory path (editor-only).
public static string EngineContentFolder => Internal_GetEngineContentFolder();
// Game source code directory path (editor-only).
public static string ProjectSourceFolder => Internal_GetProjectSourceFolder();
// Project content directory path
public static string ProjectContentFolder => Internal_GetProjectContentFolder();
In addition, ProjectContentFolder might be useful when digging in game resource directory. It refers /Content/ during development, and after building it refers the location where the resources built resides.
1 Like