C# Addendum
The ClockScript was fairly painless to convert to C#. These were the steps:
Copy/paste the JavaScript code into a new C# script (keeping the C# class definition and omitting the #pragma strict line)
Add the appropriate access modifier to the variable definitions (note: any variables that need to show up in the drag-n-drop Unity interface, like the ones that store the textures, need the
public
modifier. Useprivate
for all other variables)Change the syntax of all the variable definitions (declare the type before the variable name, and nix the colon)
Change the function declarations so that they start with the return type (
void
in all cases for this script) and an access modifier (private
for all of these functions)Add the
new
keyword when defining aRect
or aVector2
instanceExplicitly cast variables when you convert a float to an int. See this line for an example:
minutes = (int)(timeRemaining/60); // minutes is an int, while timeRemaining is a float
Remember that if you remove...