title: Trouble implementing IComparable<T> in C#
body: <p>I'm trying to sort an array in Unity by name, using <code>Array.Sort()</code>.</p>
  
  <p>I've been reading as much as I can but still can't adapt it into my little project here. Here is what I have so far:</p>
  
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  using UnityEngine.UI;
  using System;
  
  public class UIController : MonoBehaviour, IComparable&lt;Slot&gt;
  {
      public static UIController instance;
      public Text uiMessageBox;
      public Slot[] slots;
  
      private void Awake()
      {
          if (instance == null)
              instance = this;
          else
              Destroy(this);
  
          DontDestroyOnLoad(this);
  
          slots = FindObjectsOfType&lt;Slot&gt;();
          Array.Sort(slots, ); // HELP: NOT SURE WHAT TO PUT HERE
      }
  
      public int CompareTo(Slot other)
      {
          return this.name.CompareTo(other.name);
      }
  }
  </code></pre>
  
  <p>Note, I deleted the parts I think are irrelevant in this class (such as the code that displays a message string on screen etc).</p>
  
  <p>ALSO NOTE: I implement here <code>IComparable&lt;Slot&gt;</code> but I also tried it with <code>IComparable&lt;UIController&gt;</code>. (like I say, I've seen lots of examples here and other websites, but cannot quite get it to work in my code.)</p>