- Home /
where to find info on Boundary variable type?
I'm struggling to find any help in the script help on the variable type "Boundary" and what methods and properties it has available. The default penelope joystick script uses it, and I'm trying to write a script that essentially won't let a tap respond if it's inside the joysticks guiBoundary variable.
Could someone point me to where to look? Many thanks Dale
Answer by jashan · Aug 19, 2010 at 11:08 AM
It's defined up in Joystick.js, so the answer would be "look above":
// A simple class for bounding how far the GUITexture will move
class Boundary
{
var min : Vector2 = Vector2.zero;
var max : Vector2 = Vector2.zero;
}
And that's all there is to it: Two Vector2 attributes, max and min. So all you can do is myBoundary.max and myBoundary.min (assuming "myBoundary" is a variable of type Boundary). That's what I call a simple class ;-)
Anyways, almost missed this myself. That's why I really don't like it that they use JavaScript for these kinds of examples. In C#, with a proper editor (MonoDevelop or Visual Studio), all you have to do is "go to definition", and you'll know where the class was defined (usually by right-clicking on the classname where it is used; also works for methods). Well ... eventually that convenience might come for UnityScript as well (or maybe there already are editors out there that do support it and I'm just making myself look bit ignorant ;-) ).
excellent, how could I have missed that! $$anonymous$$uch appreciated and much frustration saved.