NaturalCompareObjectNames() private method

private NaturalCompareObjectNames ( Object a, Object b ) : int
a Object
b Object
return int
コード例 #1
0
        private AnimationClip[] GetOrderedClipList()
        {
            AnimationClip[] clips = new AnimationClip[0];
            if (state.activeRootGameObject != null)
            {
                clips = AnimationUtility.GetAnimationClips(state.activeRootGameObject);
            }

            //Using AlphaNum/Natural Compare to sort clips
            Array.Sort(clips, (AnimationClip clip1, AnimationClip clip2) => EditorUtility.NaturalCompareObjectNames(clip1, clip2));

            return(clips);
        }
コード例 #2
0
 public override int Compare(GameObject lhs, GameObject rhs)
 {
     if (lhs == rhs)
     {
         return(0);
     }
     if (lhs == null)
     {
         return(-1);
     }
     if (rhs == null)
     {
         return(1);
     }
     return(EditorUtility.NaturalCompareObjectNames(lhs, rhs));
 }