当前位置:编程学习 > C#/ASP.NET >>

Unity3D 实现表内对象排序(C#)

[csharp] 
// Sort by distance 
    private void SortTargetsByDistance () { 
        targets.Sort(delegate(Transform t1, Transform t2) { 
                    return Vector3.Distance(t1.position, myTransform.position).CompareTo(Vector3.Distance(t2.position, myTransform.position));           
                }); 
    } 
作者:janpylx
补充:软件开发 , C# ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,