In the first section, we will create the
UserData script, which will collect the username and score. This script will inherit from the
IComparable<T> interface, which is a custom comparison method in the .NET library that a value type or class implements to create a type-specific comparison method to order instances. This class will have the
CompareTo() function, which will be used to sort users by their score. Then, we will add the
UserData object in the
UIHiscore script and set up the input text field for the player's name.
For more information about the
IComparable<T> interface, visit the following links: