Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ClearLabels(Object)

Removes all labels attached to an asset.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor
public static void ClearLabels(Object obj)

Parameters

The asset object to remove labels from.

Remarks

The following example removes all labels from the assets selected in the Project window:

Examples

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); } }}