Tools.GetRelativePath C# (CSharp) Method

GetRelativePath() public static method

public static GetRelativePath ( ) : string
return string
    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() + "/";
        }
    }

Usage Example

Example #1
0
 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));
     }
 }
All Usage Examples Of Tools::GetRelativePath