示例#1
0
    public static string GetPath(PathType type, string u3dPathOfnoasset)
    {
        switch (type)
        {
        case PathType.absPath:
            return(Application.get_dataPath() + u3dPathOfnoasset);

        case PathType.u3dPath_no_assets:
            return(u3dPathOfnoasset);

        case PathType.u3dPath_has_asset:
        {
            string path = PathSystem.GetPath(PathType.absPath, u3dPathOfnoasset);
            return(path.Substring(path.IndexOf("Assets")));
        }

        case PathType.resourcesPath:
            if (u3dPathOfnoasset.Contains("/Resources/"))
            {
                return(u3dPathOfnoasset.Substring("/Resources/".get_Length()));
            }
            PathSystem.ShowError();
            return(string.Empty);

        case PathType.SubPackageInfo:
            return(Path.Combine(Environment.get_CurrentDirectory(), string.Format("SubPackageInfo/{0}", u3dPathOfnoasset)));

        case PathType.ApkPath:
            return(PathUtil.Combine(new string[]
            {
                PathSystem.ApkDir,
                u3dPathOfnoasset
            }));

        case PathType.ApkPatchPath:
            return(PathUtil.Combine(new string[]
            {
                PathSystem.ApkPatchDir,
                u3dPathOfnoasset
            }));

        case PathType.ResPatch:
            return(PathUtil.Combine(new string[]
            {
                PathSystem.PersistentDataPath,
                "resPatch",
                u3dPathOfnoasset
            }));

        default:
            return(string.Empty);
        }
    }