|
For example: if I call the keyword I'm a bit confused about this. Thanks from now! Cheers!
(comments are locked)
|
|
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. :) Thanks for both answers! Think was what I thought it was. To mark the correct one I'll use the criterion of who answered first, but thanks for both replies!
May 03 '12 at 03:38 AM
GutoThomas
(comments are locked)
|
|
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 :
(comments are locked)
|
