Some questions about Gui.Window

Hello,

I’m trying to make a window, for an RPG game, which holds all the information about the character.
But I’m having a few problems:

  • How do I enter the character’s stats in here? They are declared and updated in another script. They are all public, but I can’t access them. If I do declare a new instance of that script to access these stats, they will not be updated together with the original one, right?
  • In the function that GUI.Window requires, I have to return something, but I don’t understand what.

Thanks in advance!

Simon.

[1] How do I enter the character’s stats in here?

Two ways:

  1. You can make the variables static, and access them through StatusScript.Var1
  2. You can attach it to an object, and access them through GameObject.Find(“Character”).GetComponent(StatusScript).Var1

[2] In the function that GUI.Window requires, I have to return something, but I don’t understand what.

You do not need to return anything in that function. Refer to :http://unity3d.com/support/documentation/ScriptReference/GUI.Window.html