| Parameter | Description |
|---|---|
| obj | The asset object to remove labels from. |
Removes all labels attached to an asset.
The following example removes all labels from the assets selected in the Project window:
using UnityEditor; using UnityEngine;
static class AssetLabelCleanup { [MenuItem("Tools/Clear Labels On Selected Assets")] static void ClearLabelsOnSelection() { foreach (string guid in Selection.assetGUIDs) { string path = AssetDatabase.GUIDToAssetPath(guid); Object asset = AssetDatabase.LoadMainAssetAtPath(path); AssetDatabase.ClearLabels(asset); } } }