if I call the keyword
I'm a bit confused about this.
Thanks from now!
asked May 03 '12 at 02:53 AM
In C#: It will refer to the MonoBehaviour that is instantiated. ie: The component that lives in its container GameObject. So, yes, this would refer to myInstance, assuming myInstance was a reference to said component/MonoBehaviour.
In JS: Someone else will have to answer that, as I am not sure but it probably works the same. :)
answered May 03 '12 at 03:24 AM
The keyword this is indeed a reference to the object executing a member function. It's not necessary to use it in most cases, as that reference is used as well without the keyword. You should use when, for instance, a variable member of the class and a variable argument of a function member of that class have the same name. Maybe that code can make it clearer :
answered May 03 '12 at 03:32 AM