in the file teste.js —>
class happy
{
private var _x : float = 0.0;
function get x () : float { return _x; }
function set x (value : float)
{
Debug.Log("hey someone set the x value using an equals sign! whoa!");
_bar = value;
}
function Start()
{
Debug.Log("getters and setters in Unityscript are easy and happy");
}
}
All no problem. But, if you do this
in the file teste.js —>
var x:int;
it makes a variable “x” in the ingenious “Inspector” (Apple-3) panel of the Unity3D Editor. Great.
You can guess what I’m going to ask … How can I basically do this …
functionOrWhatever setOrWhatever x
{
Debug.Log("hey, somebody changed x, perhaps in the Inspector!");
x = x whatever;
}
in other words, how to do the getters / setters for the “magic’d” variables in the “implicit” classes in Unityscript
{by “implicit” I just mean the feature where if you can just blurt out code using the magic where the filename becomes the class, etc etc – I don’t actually know what the term is, if any, for that sloppy magic in Unity javascript files}
Or, in a word - if for some reason it’s not possible to get at those getters/setters, quite simply
how to know if someone has changed x in the Editor Inspector window?
Sorry for yet another ultra-lame Unityscript question.