yandex
loader

please wait

  • Ekta Singhania Mar-12-2019 12:29:05 PM ( 2 months ago )

     

    I am using the FindAll() method which returns a correct list

    List<AudioSource> playing = AudioSourceRegistry.FindAll(src => src.isPlaying == true);

    but when trying to sort the list using

    List<AudioSource> playing = AudioSourceRegistry.FindAll(src => src.isPlaying == true)
        .Sort(delegate (AudioSource a1, AudioSource a2)
        {
            return a1.mixerIndex.CompareTo(a2.mixerIndex);
        }); 

    or

    List<AudioSource> playing = AudioSourceRegistry.FindAll(src => src.isPlaying == true) .Sort(a1, a2 => a1.mixerIndex.CompareTo(a2.mixerIndex));

    results in an error

    Severity Code Description Project File Line Suppression State Error CS0029 Cannot implicitly convert type 'void' to 'System.Collections.Generic.List'

    The sort isn't return a list?

    How can I sort the result of FindAll() ?

     

Please login

Similar Discussion

Recommended For You