Difference between revisions of "Variables and Properties"

9 bytes removed ,  04:44, 13 February 2012
imported>Evernewjoy
imported>Evernewjoy
Line 159: Line 159:
int hiddenInt = 144 ;initialized value
int hiddenInt = 144 ;initialized value


;the name of the property/var you want to use in ;other scripts, which is just a wrapper for the
;the name of the property/var you want to use in other scripts, which is just a wrapper for the hidden var
;hidden var


int property publicInt
int property publicInt
Line 283: Line 282:




***
If you do not make an instance of the script that contains the variable you want to access, you cannot use the variable, you must have an object with the variable-reservoir script attached to itself.
If you do not make an instance of the script that contains the variable you want to access, you cannot use the variable, you must have an object with the variable-reservoir script attached to itself.
***
 


And remember to set the scriptVar to the script-as-a-property, the highlighted line in the script itself.
And remember to set the scriptVar to the script-as-a-property, the highlighted line in the script itself.
Anonymous user