using Godot; using System.Text; using System.Collections.Generic; namespace Rokojori { public class HierarchyName { public static string Of( Node node, string seperator = "/" ) { if ( node == null ) { return "null"; } var list = new List(); var it = node; while ( it != null ) { list.Add( it.Name ); it = it.GetParent(); } list.Reverse(); var sb = new StringBuilder(); for ( int i = 0; i < list.Count; i++) { if ( i != 0 ) { sb.Append( seperator ); } sb.Append( list[ i ] ); } return sb.ToString(); } } }