AssetBundleGraph.IntegratedPrefabBuilder.Setup C# (CSharp) Method

Setup() public method

public Setup ( BuildTarget target, NodeData node, ConnectionPointData inputPoint, ConnectionData connectionToOutput, Dictionary inputGroupAssets, List alreadyCached, Action Output ) : void
target BuildTarget
node NodeData
inputPoint ConnectionPointData
connectionToOutput ConnectionData
inputGroupAssets Dictionary
alreadyCached List
Output Action
return void
        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)
        {
            ValidatePrefabBuilder(node, target, inputGroupAssets,
                () => {
                    throw new NodeException(node.Name + " :PrefabBuilder is not configured. Please configure from Inspector.", node.Id);
                },
                () => {
                    throw new NodeException(node.Name + " :Failed to create PrefabBuilder from settings. Please fix settings from Inspector.", node.Id);
                },
                (string groupKey) => {
                    throw new NodeException(string.Format("{0} :Can not create prefab with incoming assets for group {1}.", node.Name, groupKey), node.Id);
                },
                (Asset badAsset) => {
                    throw new NodeException(string.Format("{0} :Can not import incoming asset {1}.", node.Name, badAsset.fileNameAndExtension), node.Id);
                }
            );

            var builder = PrefabBuilderUtility.CreatePrefabBuilder(node, target);
            UnityEngine.Assertions.Assert.IsNotNull(builder);

            var prefabOutputDir = FileUtility.EnsurePrefabBuilderCacheDirExists(target, node);
            Dictionary<string, List<Asset>> output = new Dictionary<string, List<Asset>>();

            foreach(var key in inputGroupAssets.Keys) {
                var prefabFileName = builder.CanCreatePrefab(key, LoadAllAssets(inputGroupAssets[key]));
                output[key] = new List<Asset> () {
                    Asset.CreateAssetWithImportPath(FileUtility.PathCombine(prefabOutputDir, prefabFileName + ".prefab"))
                };
            }

            Output(connectionToOutput, output, null);
        }