/// <summary> /// Gets a file system path for the specfic asset that should be unique. /// </summary> /// <param name="asset"></param> /// <returns></returns> public string GetUniqueFileSystemAssetPath(UnityEngine.Object asset) { var ext = asset.GetOrCreateExtensionData <ResourceExtensionData>(); if (ext.FullFileSystemAssetPath == null) { string path = string.Empty; if (!string.IsNullOrEmpty(Parameters.Path)) { path = Parameters.Path.ToLowerInvariant(); } if (Parameters.LoadType == ResourceLoadType.LoadByType) { var assetName = asset.name; if (!string.IsNullOrEmpty(assetName)) { path = Path.Combine(path, assetName.ToLowerInvariant()); } else { string suffix = null; if (Assets.Length > 1) { var idx = Array.IndexOf(Assets, asset); if (idx == -1) { suffix = "_with_unknown_index"; } else { suffix = "_" + idx.ToString(CultureInfo.InvariantCulture); } } path = Path.Combine(path, "unnamed_asset" + suffix); } } path = path.UseCorrectDirectorySeparators(); ext.FullFileSystemAssetPath = path; } return(ext.FullFileSystemAssetPath); }