AssetBundleGraph.Asset.CreateAssetWithImportPath C# (CSharp) Method

CreateAssetWithImportPath() public static method

public static CreateAssetWithImportPath ( string importFrom ) : Asset
importFrom string
return Asset
        public static Asset CreateAssetWithImportPath(string importFrom)
        {
            return new Asset(
                guid: Guid.NewGuid(),
                importFrom:importFrom);
        }

Usage Example

Example #1
0
        public void Setup(string nodeName, string nodeId, string unused_connectionIdToNextNode, Dictionary <string, List <Asset> > groupedSources, List <string> alreadyCached, Action <string, string, Dictionary <string, List <Asset> >, List <string> > Output)
        {
            try {
                ValidateBundleNameTemplate(
                    bundleNameTemplate,
                    () => {
                    throw new NodeException(nodeName + ":Bundle Name Template is empty.", nodeId);
                }
                    );

                foreach (var name in variants.Values)
                {
                    ValidateVariantName(name, variants.Values.ToList(),
                                        () => {
                        throw new NodeException(nodeName + ":Variant is empty.", nodeId);
                    },
                                        () => {
                        throw new NodeException(nodeName + ":Variant name cannot contain whitespace \"" + name + "\".", nodeId);
                    },
                                        () => {
                        throw new NodeException(nodeName + ":Variant name already exists \"" + name + "\".", nodeId);
                    });
                }
            } catch (NodeException e) {
                AssetBundleGraphEditorWindow.AddNodeException(e);
                return;
            }

            var recommendedBundleOutputDir = FileUtility.PathCombine(AssetBundleGraphSettings.BUNDLIZER_CACHE_PLACE, nodeId, SystemDataUtility.GetCurrentPlatformKey());

            var outputDict = new Dictionary <string, List <Asset> >();

            foreach (var groupKey in groupedSources.Keys)
            {
                var inputSources = groupedSources[groupKey];

                var reservedBundlePath = BundlizeAssets(nodeName, groupKey, inputSources, recommendedBundleOutputDir, false);
                if (string.IsNullOrEmpty(reservedBundlePath))
                {
                    continue;
                }

                var outputSources = new List <Asset>();

                var newAssetData = Asset.CreateAssetWithImportPath(reservedBundlePath);

                outputSources.Add(newAssetData);

                outputDict[groupKey] = outputSources;
            }

            if (assetsOutputConnectionId != AssetBundleGraphSettings.BUNDLIZER_FAKE_CONNECTION_ID)
            {
                Output(nodeId, assetsOutputConnectionId, outputDict, new List <string>());
            }
        }
All Usage Examples Of AssetBundleGraph.Asset::CreateAssetWithImportPath