ドキュメント

Unity Engine

Unity Engine

PingObject

Ping an object in the Scene like clicking it in an inspector.
読み終わるまでの所要時間 2 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule

PingObject(Object)

Ping an object in the Scene like clicking it in an inspector.
public static void PingObject(Object obj)

Parameters

The object to be pinged.

Remarks

EditorGUIUtility.PingObject will cause the Hierarchy to highlight the pinged object. The pinged object does not have to be selected. For example GameObject.Find can be used to locate an object to ping.

Examples

// Pings the currently selected Objectusing UnityEditor;using UnityEngine;public class PingObjectExample{ [MenuItem("Examples/Ping Selected")] static void Ping() { if (!Selection.activeObject) { Debug.Log("Select an object to ping"); return; } EditorGUIUtility.PingObject(Selection.activeObject); }}

PingObject(int)

Ping an object in the Scene like clicking it in an inspector.
注意
Removed. PingObject(int) is obsolete. Use PingObject(EntityId) instead.
public static void PingObject(int targetInstanceID)

Parameters

targetInstanceID

Remarks

EditorGUIUtility.PingObject will cause the Hierarchy to highlight the pinged object. The pinged object does not have to be selected. For example GameObject.Find can be used to locate an object to ping.

Examples

// Pings the currently selected Objectusing UnityEditor;using UnityEngine;public class PingObjectExample{ [MenuItem("Examples/Ping Selected")] static void Ping() { if (!Selection.activeObject) { Debug.Log("Select an object to ping"); return; } EditorGUIUtility.PingObject(Selection.activeObject); }}

PingObject(EntityId)

Ping an object in the Scene like clicking it in an inspector.
public static void PingObject(EntityId targetEntityId)

Parameters

targetEntityId

Remarks

EditorGUIUtility.PingObject will cause the Hierarchy to highlight the pinged object. The pinged object does not have to be selected. For example GameObject.Find can be used to locate an object to ping.

Examples

// Pings the currently selected Objectusing UnityEditor;using UnityEngine;public class PingObjectExample{ [MenuItem("Examples/Ping Selected")] static void Ping() { if (!Selection.activeObject) { Debug.Log("Select an object to ping"); return; } EditorGUIUtility.PingObject(Selection.activeObject); }}