public static string GetPath(Transform root, Transform transform)
{
string path = "";
Transform current = transform;
if(root)
{
while(current && current != root)
{
path = current.name + path;
current = current.parent;
if(current != root)
{
path = "/" + path;
}
}
if(!current)
{
path = "";
}
}
return path;
}