Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetIconForGameObject(GameObject)

Retrieves the icon for the given GameObject.
Read time 1 minuteLast updated 10 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule
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.