#if UNITY_EDITOR using System.Collections; using System.Collections.Generic; using UnityEditor; using UnityEngine; public class RoadPointSort : MonoBehaviour { [MenuItem("Tools/路径反排序")] public static void FanSortRoadPoint() { Transform trans = Selection.gameObjects[0].transform; Transform[] pointarr = new Transform[trans.childCount]; for (int i = 0; i < trans.childCount; i++) { pointarr[i] = trans.GetChild(trans.childCount - i - 1); } for (int i = 0; i < pointarr.Length; i++) { trans.GetChild(i).localPosition = pointarr[i].localPosition; } } } #endif