Huy Vũ Quang

22 bundles
1 file3 months ago
5

Unity Persistant Data

Get Path by OS

1234567891011private static string GetPathBasedOnOS()
{
    if (Application.isEditor)
        return "file://" + Application.persistentDataPath + "/";
    else if (Application.isWebPlayer)
        return System.IO.Path.GetDirectoryName(Application.absoluteURL).Replace("\\", "/") + "/";
    else if (Application.isMobilePlatform || Application.isConsolePlatform)
        return Application.persistentDataPath;
    else // For standalone player.
        return "file://" +  Application.persistentDataPath + "/";
}