public static string ResourceToExportPath(Object asset, string resourceName) { bool replace = false; string validName = asset.TryGetName(); if (validName.Length > 0) { if (validName != resourceName && resourceName.EndsWith(validName, StringComparison.OrdinalIgnoreCase)) { if (validName.Length == resourceName.Length) { replace = true; } else if (resourceName[resourceName.Length - validName.Length - 1] == DirectorySeparator) { replace = true; } } } if (replace) { string directoryPath = resourceName.Substring(0, resourceName.Length - validName.Length); return(Path.Combine(AssetsKeyword, ResourceKeyword, directoryPath + validName)); } else { return(Path.Combine(AssetsKeyword, ResourceKeyword, resourceName)); } }
public static string ResourceToExportPath(Object asset, string resourceName) { string validName = asset.TryGetName(); if (validName.Length > 0 && validName != resourceName && resourceName.EndsWith(validName, StringComparison.OrdinalIgnoreCase)) { string directoryPath = resourceName.Substring(0, resourceName.Length - validName.Length); return(Path.Combine(AssetsKeyword, ResourceKeyword, directoryPath, validName)); } else { return(Path.Combine(AssetsKeyword, ResourceKeyword, resourceName)); } }
public static string SubstituteResourcePath(Object asset, string resourcePath) { return(Path.Combine(ResourceFullPath, SubstituteExportPath(resourcePath, asset.TryGetName()))); }
public static string SubstituteAssetBundlePath(Object asset, string assetPath) { return(SubstituteExportPath(assetPath, asset.TryGetName())); }