文档

Unity Engine

Unity Engine

GetIconForGameObject(GameObject)

Retrieves the icon for the given GameObject.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor
public static Texture2D GetIconForGameObject(GameObject gameObject)

Parameters

gameObject

The GameObject to get an icon for.

Returns

Type

Description

Texture2DThe icon for the GameObject.

Remarks

This method returns the icon for the GameObject, as it appears in the Hierarchy or Project Browser. Prefab instance or Asset roots have a Prefab, Prefab Mode, or Prefab Variant icon, while other GameObjects have a regular GameObject icon.