Порой, бывает удобно вывести в консоль отладки полный путь с иерархией в сцене того объекта, который это сообщение вызвал:
А вот как это можно сделать:
using UnityEngine; public class Test : MonoBehaviour { public static string GetHierarchyPath(Component inComponent) { if (inComponent) { string path = inComponent.name; while (inComponent && inComponent.transform.parent) { inComponent = inComponent.transform.parent; path = inComponent.name + "/" + path; } return path; } return string.Empty; } void Start () { Debug.Log("I am here -> " + GetHierarchyPath(this)); } }