private var PlayerScript:Player;
function Start () {
PlayerScript = playerTransform.GetComponent(Player);
}
function Update () {
if (PlayerScript.check){
//do stuff.
}
}
This is just some pieces of my code. When I try to access a public variable, like in the if statement above, PlayerScript.check, would this drain down performance, even if I access such variable multiple times in an update function?