Simple Java to C# Custom GUI question

Hey all,

Recently purchased Ryan Creighton’s “Unity 3D Game Development By Example” and was working my way through it in Javascript when my project head told me to switch to C#.

Now I’m trying to read the examples and convert them into C# (with little knowledge of either.)

Trying to set up this script to create and link a custom GUI skin. How would I write this in C# so I can add / remove the custom GUI via the Inspector?

JS Code:

var customSkin : GUISkin;

function OnGUI ()
{
  if (GUI.Button (Rect (0, 0, 100, 50), "Play Game"))
  {
    print ("You clicked me!");
  }
}

Man, maybe I should just drop this book and try to find some C#-geared stuff online. :stuck_out_tongue:

Thanks for your time!

BKF

public GUISkin customSkin;

void OnGUI ()
{
  if (GUI.Button (new Rect (0, 0, 100, 50), "Play Game"))
  {
    Debug.Log("You clicked me!");
  }
}