|
can a guitexture be a static var? I am trying to access a guitexture that in in another js file. I made it a static variable but am not having any luck. Is this even possible?
(comments are locked)
|
|
var myGUI: GUITexture=gameObject.GetComponent(GUITexture);
(comments are locked)
|
|
Why don't you just get its reference from the other Game Object?
(Note that that code should NOT be placed inside of an Update() function, and will ONLY find the first GUITexture you have.) Or, instead of using FindObjectOfType(), you could also:
Then, you could just get the component from the game object like so:
(comments are locked)
|

I need code to be added to update function so it can checked to see if a boolean is true or false constantly throughott he game. any other suggestions. I am using javascript.
function Update(){
if(FrontDoorExt.check==true) {print("test"); } }
//FrontDoorExt is the name of the js that is storing the boolean. // There is a guitexture in it that is enabled. But i keep getting an error that says "an instance type of "FrontDoorExt" is required to access non static member var "check"