I have a static public boolean in a JavaScript and I want to access it in a C# script. When I tried the way that you would call a static variable from another script though, it said that the variable and script weren't recognized. Here is my JavaScript code:
public static var ItemPurchased = false;
function OnGUI () {
if (GUI.Button(new Rect(10, 90, 190, 24), "Click here to collect water.")){
ItemPurchased = true;
}
I do believe that the JavaScript is correct. On the other hand, here is my C# script:
public static bool itemowned = false;
void Update () {
if(PurchaseItemScript.ItemPurchased == true){
itemowned = true;
PurchaseItemScript.ItemPurchased = false;
}
}
PLZ HELP!