private List <Transform> GetPath(Transform startTrans, Transform endTrans) { Node startNode = startTrans.parent.GetComponent <Node>(); Node.WalkableAxis startAxis = StandingAxis; Node endNode = endTrans.parent.GetComponent <Node>(); Node.WalkableAxis endAxis = Node.GetWalkAxisByName(endTrans.name); PathTree pathTree = new PathTree(new PathTreeNode(startNode, startAxis, null)); pathTree.Init(); List <Transform> pathTrans = pathTree.FindPathFromStartToEnd(endNode, endAxis); if (pathTrans == null) { return(null); } return(pathTrans); }