Anima2D.BoneUtils.GetPath C# (CSharp) Method

GetPath() public static method

public static GetPath ( Transform root, Transform transform ) : string
root Transform
transform Transform
return string
		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;
		}