Hello, I have some things that old question in my head.
I am using C #.
which is actually faster to use static variables or getcomponent?
//example using getcomponent:
public GameManager gameManager;
void Awake()
{
gameManager = GameObject.FindGameObjectWithTag ("GameManager"). GetComponent ();
}
//for next i acces script GameManaget via variable gameManager.
//example using static variabel :
public static GameManager gameManager;
public int score = 0;
void Awake()
{
gameManager = this;
}
//in other script
GameManger.gameManager.score = 1;
which is actually faster?