You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
680 B

#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