|
Java Code - Static Variable
[Back]
Code:
//We going to set up a Static var
//A Static var is a var that you can use everywhere in your game
//So first let make a new script and name it Maincode
//You do not need to place this script down anywhere in your game it will work just by having it
#pragma strict
static var test = 0; //Static Var
//If you wish to call it from another script use this
Maincode.test = 0;
//The Maincode. Is where the script get call from, (test) is the name of the var in the Maincode Script
//A Static var is a var that you can use everywhere in your game
//So first let make a new script and name it Maincode
//You do not need to place this script down anywhere in your game it will work just by having it
#pragma strict
static var test = 0; //Static Var
//If you wish to call it from another script use this
Maincode.test = 0;
//The Maincode. Is where the script get call from, (test) is the name of the var in the Maincode Script