void Update() { if (outOfBounds.IsOutOfBounds(gameObject.transform)) { gameObject.SetActive(false); } }
void Update() { if (outOfBounds == null) { gameController = GameControllerScript.GetInstance(); outOfBounds = gameController.GetComponent <OutOfBounds>(); } if (outOfBounds.IsOutOfBounds(gameObject.transform)) { gameObject.SetActive(false); } }