Beispiel #1
0
        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));
            }
        }
Beispiel #2
0
        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));
            }
        }
Beispiel #3
0
 public static string SubstituteResourcePath(Object asset, string resourcePath)
 {
     return(Path.Combine(ResourceFullPath, SubstituteExportPath(resourcePath, asset.TryGetName())));
 }
Beispiel #4
0
 public static string SubstituteAssetBundlePath(Object asset, string assetPath)
 {
     return(SubstituteExportPath(assetPath, asset.TryGetName()));
 }