I would like to get static var money from my other scene so it may increase or decrease. Is it possible? if so, can you show how? thanks! :?:
static var don’t get destroy across scene.
make a “non MonoBehavior” script where you put your static var if you want then you will be able to access them at any place anytime in your game.
Thanks! Can you please give some example like using variable: money?
Since they’re associated with the type, I would imagine it should still work even if associated with a MonoBehaviour object (unless Unity does something automagically in the background)
EDIT: Off the top of my head:
class SomeCustomData
{
public static var Money : float;
}
//in some other script:
var currentMoney : float = SomeCustomData.Money;
Thanks FixixMan! Ill try it soon as possible. still stuck with GUIBoxes lol.