What is the fastest way to get GameObject reference?

Viewed 907

Let's say my script is defined as given below.

public GameObject _GameObject;

private void Start()
{
[![enter image description here][1]][1]
    _GameObject = gameObject;
}


Would this execute faster?

public void SetActive(bool value)
{
  [1]: https://i.stack.imgur.com/S60FB.jpg
    gameObject.SetActive(value);
}

Or this?

public void SetActive(bool value)
{
    _GameObject.SetActive(value);
}
2 Answers
Related