Get the Asset paths for all Assets tagged with assetBundleName and named assetName.
Get the Asset paths for all Assets tagged with assetBundleName and named assetName, regardless of extension or path e.g. "Assets/House.prefab", "Assets/Textures/House.png" and "Assets/Data/House.xml" when assetName is "House".
#pragma strict public class ExampleScript { @MenuItem("AssetDatabase/Display assets in an AssetBundle") static function ExampleScriptCode1() { var assetPaths: String[] = AssetDatabase.GetAssetPathsFromAssetBundleAndAssetName("assetname", "House"); for (var assetPath: var in assetPaths) Debug.Log(assetPath); } @MenuItem("AssetDatabase/AssetBundle creation") static function ExampleScriptCode2() { BuildPipeline.BuildAssetBundles("Assets/AssetBundles", BuildAssetBundleOptions.None, BuildTarget.StandaloneOSXIntel); } }
using UnityEditor; using UnityEngine;
public class ExampleScript { [MenuItem("AssetDatabase/Display assets in an AssetBundle")] static void ExampleScriptCode1() { string[] assetPaths = AssetDatabase.GetAssetPathsFromAssetBundleAndAssetName("assetname", "House"); foreach (var assetPath in assetPaths) Debug.Log(assetPath); }
[MenuItem("AssetDatabase/AssetBundle creation")] static void ExampleScriptCode2() { BuildPipeline.BuildAssetBundles("Assets/AssetBundles", BuildAssetBundleOptions.None, BuildTarget.StandaloneOSXIntel); } }