void Load(BuildTarget target, NodeData node, IEnumerable <ConnectionData> connectionsToOutput, PerformGraph.Output Output) { if (connectionsToOutput == null || Output == null) { return; } // SOMEWHERE_FULLPATH/PROJECT_FOLDER/Assets/ var assetsFolderPath = Application.dataPath + AssetBundleGraphSettings.UNITY_FOLDER_SEPARATOR; var outputSource = new List <AssetReference>(); var targetFilePaths = FileUtility.GetAllFilePathsInFolder(node.GetLoaderFullLoadPath(target)); foreach (var targetFilePath in targetFilePaths) { if (targetFilePath.Contains(AssetBundleGraphSettings.ASSETBUNDLEGRAPH_PATH)) { continue; } // already contained into Assets/ folder. // imported path is Assets/SOMEWHERE_FILE_EXISTS. if (targetFilePath.StartsWith(assetsFolderPath)) { var relativePath = targetFilePath.Replace(assetsFolderPath, AssetBundleGraphSettings.ASSETS_PATH); var r = AssetReferenceDatabase.GetReference(relativePath); if (!TypeUtility.IsLoadingAsset(r)) { continue; } if (r != null) { outputSource.Add(AssetReferenceDatabase.GetReference(relativePath)); } continue; } throw new NodeException(node.Name + ": Invalid Load Path. Path must start with Assets/", node.Name); } var output = new Dictionary <string, List <AssetReference> > { { "0", outputSource } }; var dst = (connectionsToOutput == null || !connectionsToOutput.Any())? null : connectionsToOutput.First(); Output(dst, output); }
public void Setup(BuildTarget target, NodeData node, IEnumerable <PerformGraph.AssetGroups> incoming, IEnumerable <ConnectionData> connectionsToOutput, PerformGraph.Output Output) { ValidateLoadPath( node.LoaderLoadPath[target], node.GetLoaderFullLoadPath(target), () => { //can be empty //throw new NodeException(node.Name + ": Load Path is empty.", node.Id); }, () => { throw new NodeException(node.Name + ": Directory not found: " + node.GetLoaderFullLoadPath(target), node.Id); } ); Load(target, node, connectionsToOutput, Output); }
public void Setup(BuildTarget target, NodeData node, ConnectionPointData inputPoint, ConnectionData connectionToOutput, Dictionary <string, List <Asset> > inputGroupAssets, List <string> alreadyCached, Action <ConnectionData, Dictionary <string, List <Asset> >, List <string> > Output) { ValidateLoadPath( node.LoaderLoadPath[target], node.GetLoaderFullLoadPath(target), () => { //can be empty //throw new NodeException(node.Name + ": Load Path is empty.", node.Id); }, () => { throw new NodeException(node.Name + ": Directory not found: " + node.GetLoaderFullLoadPath(target), node.Id); } ); Load(target, node, connectionToOutput, inputGroupAssets, Output); }
public void Setup(BuildTarget target, NodeData node, ConnectionPointData inputPoint, ConnectionData connectionToOutput, Dictionary<string, List<Asset>> inputGroupAssets, List<string> alreadyCached, Action<ConnectionData, Dictionary<string, List<Asset>>, List<string>> Output) { ValidateLoadPath( node.LoaderLoadPath[target], node.GetLoaderFullLoadPath(target), () => { //can be empty //throw new NodeException(node.Name + ": Load Path is empty.", node.Id); }, () => { throw new NodeException(node.Name + ": Directory not found: " + node.GetLoaderFullLoadPath(target), node.Id); } ); Load(target, node, connectionToOutput, inputGroupAssets, Output); }
void Load(BuildTarget target, NodeData node, ConnectionData connectionToOutput, Dictionary <string, List <Asset> > inputGroupAssets, Action <ConnectionData, Dictionary <string, List <Asset> >, List <string> > Output) { // SOMEWHERE_FULLPATH/PROJECT_FOLDER/Assets/ var assetsFolderPath = Application.dataPath + AssetBundleGraphSettings.UNITY_FOLDER_SEPARATOR; var outputSource = new List <Asset>(); var targetFilePaths = FileUtility.GetAllFilePathsInFolder(node.GetLoaderFullLoadPath(target)); foreach (var targetFilePath in targetFilePaths) { if (targetFilePath.Contains(AssetBundleGraphSettings.ASSETBUNDLEGRAPH_PATH)) { continue; } // already contained into Assets/ folder. // imported path is Assets/SOMEWHERE_FILE_EXISTS. if (targetFilePath.StartsWith(assetsFolderPath)) { var relativePath = targetFilePath.Replace(assetsFolderPath, AssetBundleGraphSettings.ASSETS_PATH); var assetType = TypeUtility.GetTypeOfAsset(relativePath); if (assetType == typeof(object)) { continue; } outputSource.Add(Asset.CreateNewAssetFromLoader(targetFilePath, relativePath)); continue; } throw new NodeException(node.Name + ": Invalid Load Path. Path must start with Assets/", node.Name); } var outputDir = new Dictionary <string, List <Asset> > { { "0", outputSource } }; Output(connectionToOutput, outputDir, null); }
void Load(BuildTarget target, NodeData node, ConnectionData connectionToOutput, Dictionary<string, List<Asset>> inputGroupAssets, Action<ConnectionData, Dictionary<string, List<Asset>>, List<string>> Output) { // SOMEWHERE_FULLPATH/PROJECT_FOLDER/Assets/ var assetsFolderPath = Application.dataPath + AssetBundleGraphSettings.UNITY_FOLDER_SEPARATOR; var outputSource = new List<Asset>(); var targetFilePaths = FileUtility.GetAllFilePathsInFolder(node.GetLoaderFullLoadPath(target)); foreach (var targetFilePath in targetFilePaths) { if(targetFilePath.Contains(AssetBundleGraphSettings.ASSETBUNDLEGRAPH_PATH)) { continue; } // already contained into Assets/ folder. // imported path is Assets/SOMEWHERE_FILE_EXISTS. if (targetFilePath.StartsWith(assetsFolderPath)) { var relativePath = targetFilePath.Replace(assetsFolderPath, AssetBundleGraphSettings.ASSETS_PATH); var assetType = TypeUtility.GetTypeOfAsset(relativePath); if (assetType == typeof(object)) { continue; } outputSource.Add(Asset.CreateNewAssetFromLoader(targetFilePath, relativePath)); continue; } throw new NodeException(node.Name + ": Invalid Load Path. Path must start with Assets/", node.Name); } var outputDir = new Dictionary<string, List<Asset>> { {"0", outputSource} }; Output(connectionToOutput, outputDir, null); }