void Start() { myRigidbody2D = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); animator.SetBool("Dying", false); var gameObject = GameObject.Find("LevelMenu"); if (gameObject != null) { levelMenu = gameObject.GetComponent <LevelMenu>(); } gameObject = GameObject.Find("Options"); if (gameObject != null) { smoothPitchChanger = gameObject.GetComponent <SmoothPitchChanger>(); } }
void Start() { myRigidbody2D = GetComponent<Rigidbody2D>(); animator = GetComponent<Animator>(); animator.SetBool("Dying", false); var gameObject = GameObject.Find("LevelMenu"); if (gameObject != null) { levelMenu = gameObject.GetComponent<LevelMenu>(); } gameObject = GameObject.Find("Options"); if (gameObject != null) { smoothPitchChanger = gameObject.GetComponent<SmoothPitchChanger>(); } }