Game Development Reference
In-Depth Information
Engage thrusters
Now, we can start creating the UserData script by performing the following steps:
1. Double-click on the UserData script that we just created and include the code as
follows:
// Unity JavaScript user:
#pragma strict
import System;
import System.Collections.Generic;
public class UserData implements
IComparable.<UserData> {
var name : String;
var score : int;
public function CompareTo ( compare : UserData ) :
int
{
// Null value means that this object is greater
if (compare == null) return 1;
else {
return this.score.CompareTo(compare.score);
}
}
}
// C# user:
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
[System.Serializable]
public class UserData : IComparable<UserData> {
Search WWH ::




Custom Search