Class TAssetBundleManifest
- Namespace
- TAssetBundle.Editor
- Assembly
- TAssetBundle.Editor.dll
The main manifest file that manages AssetBundle builds.
This ScriptableObject defines:
- Which assets belong to which AssetBundle
- How assets are grouped (via composition strategies)
- Build options (builtin, encryption, tags)
Create via: Right-click > Create > TAssetBundle > TAssetBundleManifest
[CreateAssetMenu(menuName = "TAssetBundle/TAssetBundleManifest")]
public class TAssetBundleManifest : ScriptableObject
- Inheritance
-
ObjectScriptableObjectTAssetBundleManifest
- Inherited Members
-
ScriptableObject.SetDirty()ScriptableObject.CreateInstance<T>()Object.GetInstanceID()Object.GetHashCode()Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
- Extension Methods
Fields
assetBundleBuildInfos
The actual list of AssetBundles to build. Each entry defines one bundle with its name and contents.
public List<AssetBundleBuildInfo> assetBundleBuildInfos
Field Value
builtin
When true, bundles are included in the app's StreamingAssets folder. When false, bundles must be downloaded from a remote server.
[Tooltip("Are AssetBundles built into the app?")]
public bool builtin
Field Value
compositionStrategyInfos
List of strategies that auto-generate AssetBundle groupings. Run via context menu "Run Composition Strategy".
public List<CompositionStrategyInfo> compositionStrategyInfos
Field Value
enabled
When false, this manifest is skipped during AssetBundle builds. Useful for temporarily disabling certain bundles.
[Tooltip("Activation options (excluded from build when inactive)")]
public bool enabled
Field Value
encrypt
When true, bundles from this manifest will be encrypted. Provides basic protection against casual inspection.
[Tooltip("Are the AssetBundles in this manifest encrypted?")]
public bool encrypt
Field Value
ignoreAssets
Assets in this list are excluded from AssetBundle builds. They won't appear in "not included" warnings.
public List<Object> ignoreAssets
Field Value
- List<Object>
tag
Tags for categorizing and filtering this manifest. Useful for selective downloads (e.g., "hd", "lang-en", "optional").
[Tooltip("Tags")]
public TagInfo tag
Field Value
Properties
Depth
The folder depth of this manifest (number of '/' in path). Used to process deeper manifests first during builds.
public int Depth { get; }
Property Value
IncludedAssetCount
Gets the total count of included assets. Uses cached data for O(1) performance.
public int IncludedAssetCount { get; }
Property Value
IsPersistent
Returns true if this manifest is saved as an asset file. False for runtime-created instances.
public bool IsPersistent { get; }
Property Value
ManifestPath
The project-relative path to this manifest file. Example: "Assets/Bundles/Characters/manifest.asset"
public string ManifestPath { get; }
Property Value
Methods
AddAssetBundleBuildInfo(AssetBundleBuildInfo)
Adds a new AssetBundle entry to this manifest. Logs the bundle name and included file names.
public void AddAssetBundleBuildInfo(AssetBundleBuildInfo assetBundleBuildInfo)
Parameters
assetBundleBuildInfoAssetBundleBuildInfoThe bundle configuration to add
AddNewAssetsAllTogether()
Collects all assets not yet assigned to any bundle and adds them as a single new AssetBundle. The bundle is named after the first asset. Useful for quickly bundling remaining loose assets.
[ContextMenu("Add New Asset All Together")]
public void AddNewAssetsAllTogether()
ClearAssetBundleBuildInfos()
Removes all AssetBundle build entries from this manifest. Use with caution - this clears the entire bundle configuration.
[ContextMenu("Clear Asset Bundle Build Infos")]
public void ClearAssetBundleBuildInfos()
GetAllIncludedAssetPaths()
Gets all included asset paths in this manifest. Uses cached list for fast enumeration.
public IReadOnlyList<string> GetAllIncludedAssetPaths()
Returns
- IReadOnlyList<string>
Read-only collection of all asset paths
GetNotIncludedAssetPaths()
Gets the file paths of all unassigned assets. Convenience wrapper around GetNotIncludedAssets().
public string[] GetNotIncludedAssetPaths()
Returns
- string[]
Array of asset paths (e.g., "Assets/Textures/foo.png")
GetNotIncludedAssets()
Finds all assets in this manifest's folder that are not assigned to any bundle (including child manifests) and not in ignoreAssets.
public Object[] GetNotIncludedAssets()
Returns
- Object[]
Array of unassigned asset objects
MarkAsDirty()
Marks this manifest as modified so Unity will save it. Also triggers the OnChanged event for subscribers. Invalidates the included assets cache.
public void MarkAsDirty()
RemoveTag(string)
Removes a tag from this manifest.
public void RemoveTag(string removeTag)
Parameters
removeTagstringThe tag string to remove
RenameTag(string, string)
Renames an existing tag to a new value.
public void RenameTag(string oldTag, string newTag)
Parameters
RunCompositionStrategy()
Executes all composition strategies in order. Strategies auto-generate bundle groupings based on their rules. Empty bundles are automatically removed after execution.
[ContextMenu("Run Composition Strategy")]
public void RunCompositionStrategy()
Save()
Saves the manifest to disk. Call this after making changes to persist them.
[ContextMenu("Save")]
public void Save()
SearchAssets(string)
Searches for assets by path or name. Uses cached data for O(n) search where n is the number of matching assets. Case-insensitive search.
public IEnumerable<AssetSearchResult> SearchAssets(string query)
Parameters
querystringSearch query (partial path or filename)
Returns
- IEnumerable<AssetSearchResult>
Enumerable of matching search results with bundle info
TryGetAssetInfo(string, out AssetSearchResult)
Gets the bundle info for a specific asset path. Uses cached dictionary for O(1) lookup.
public bool TryGetAssetInfo(string assetPath, out AssetSearchResult result)
Parameters
assetPathstringThe exact asset path to look up
resultAssetSearchResultThe search result if found
Returns
- bool
True if the asset was found, false otherwise
Events
OnChanged
Fired whenever this manifest is modified. Subscribers can refresh their UI or update dependencies.
public event Action<TAssetBundleManifest> OnChanged