public void CollectingBottle() { collected += 1; bottleText.text = collected.ToString(); if (collected == 5) { groundManager.LengyhUpdate(-1); } if (groundManager.length > 13) { groundManager.LengyhUpdate(4); score += 30; } }
private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Bottle") && gameManager.isGameActive) { Destroy(other.gameObject); gameManager.CollectingBottle(); Debug.Log(gameManager.collected); } else if (other.gameObject.CompareTag("Recycle") && gameManager.isGameActive) { gameManager.ScoreCalculate(); } else if (other.gameObject.CompareTag("Trashcan") && gameManager.isGameActive) { gameManager.ScoreDownCal(); } else if (other.gameObject.CompareTag("Opsticale") && gameManager.isGameActive) { groundManager.LengyhUpdate(1); } }