// Sort by distance in descending order
private void SortTargetsByDistance () {
targets.Sort(delegate(Transform t1, Transform t2) {
return Vector3.Distance(t1.position, myTransform.position).CompareTo(Vector3.Distance(t2.position, myTransform.position));
});
}
Unity3D 实现表内对象排序(C#)
最新推荐文章于 2024-05-21 23:56:53 发布