public static string GetRelativePath() { if (Application.isEditor) { //return "file://" + System.Environment.CurrentDirectory.Replace("\\", "/") + "/Assets/" + AppConst.AssetDir + "/"; return "file://" + Application.streamingAssetsPath + "/" + GetOS() + "/"; } else if (Application.isMobilePlatform || Application.isConsolePlatform) { return "file:///" + DataPath; } else // For standalone player. { return "file://" + Application.streamingAssetsPath + "/" + GetOS() + "/"; } }
static int GetRelativePath(IntPtr L) { try { ToLua.CheckArgsCount(L, 0); string o = Tools.GetRelativePath(); LuaDLL.lua_pushstring(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }