private void OnTriggerEnter(Collider other) { if (other.tag == "Player1") { gameManager.setPlayerScore(1); } else if (other.tag == "Player2") { gameManager.setPlayerScore(2); } pickUpManager.resetSpawnPointStatus(spawnPointIndex); Destroy(this.gameObject); }
private void OnTriggerEnter(Collider other) { //int powerUpIndex = Random.Range(0, 1); if (other.tag == "Player1") { //gameManager.speedBuff(1, bootsUp); // if(powerUpIndex == 0) //StartCoroutine(gameManager.enableSpeedP1()); gameManager.enableSpeed(1); } else if (other.tag == "Player2") { //gameManager.speedBuff(2, bootsUp); //StartCoroutine(gameManager.enableSpeedP2()); gameManager.enableSpeed(2); } pickUpManager.resetSpawnPointStatus(spawnPointIndex); //this.gameObject.SetActive(false); Destroy(this.gameObject); }