`GetComponent()` returns a `Component`. That's a Unity base class. When you create a script, it inherits from `Component`. The script you create has extra members, of course, so, in your example, it looks as though your script has a member called `isBuild`. When you use `GetComponent()` to find your script, you can do:
var s : YourScript = g.GetComponent(YourScript) as YourScript;
if (s.isBuild) {
//blah
This grabs the component, and casts it to `YourScript`, which has the `isBuild` member. Alternatively you can use the generic version:
var s : YourScript = g.GetComponent.();
if (s.isBuild) {
//blah
which does the exact same thing. Obviously you'd check that `s` has a value before using it.
↧