ClearLabels(Object)
Removes all labels attached to an asset.
阅读时间1 分钟最后更新于 1 个月前
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
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); } }}