public void SetRelativePath(string rPath) { Dir_Relative = AssetBundleSettingHelper.PathToPlatformFormat(rPath); var rootPath = AssetBundleSettingHelper.PathToPlatformFormat(Application.dataPath); rootPath = rootPath.Substring(0, rootPath.Length - AssetBundleSettingHelper.Asset_RelativePath.Length); Dir_Full = Path.Combine(rootPath, Dir_Relative); if (NameWithExt != null) { FullName_RelativePath = (Path.Combine(Dir_Relative, NameWithExt)); FullName = Path.Combine(rootPath, FullName_RelativePath); URI = AssetBundleSettingHelper.PathToFileUri(FullName); FullNameWithoutExtName_Relative = FullName_RelativePath.Substring(0, FullName_RelativePath.Length - ExtName.Length); } }
public void SetPath(string path) { path = AssetBundleSettingHelper.PathToPlatformFormat(path);; var rootPath = AssetBundleSettingHelper.PathToPlatformFormat(Application.dataPath); rootPath = rootPath.Substring(0, rootPath.Length - AssetBundleSettingHelper.Asset_RelativePath.Length); if (NameWithExt != null) { FullName = AssetBundleSettingHelper.PathToPlatformFormat(Path.Combine(path, NameWithExt)); var index = FullName.IndexOf(rootPath) + rootPath.Length; if (index < FullName.Length) { FullName_RelativePath = FullName.Substring(index); FullNameWithoutExtName_Relative = FullName_RelativePath.Substring(0, FullName_RelativePath.Length - ExtName.Length); } else { Debug.LogError("ABPInfo::SetPath Error:" + FullName + " :pathPrefix:" + rootPath); } URI = AssetBundleSettingHelper.PathToFileUri(FullName); } Dir_Relative = path.Substring(path.IndexOf(rootPath) + rootPath.Length + 1); Dir_Full = path; }