public void SpawnTriggerEntered() { roadSpawner.MoveRoad(); carSpawner.SpawnCar(); pickUpSpawner.SpawnPickUp(); environmentSpawner.SpawnTile(); enemySpawner.SpawnEnemy(); }
public void SpawnTriggerEntered() { if (roadSpawner.roadCanBend == true) { roadType = DecideType(); if (roadType > 0) { roadSpawner.roadBending = true; } } if (roadSpawner.howManyRoadBending == 0) { roadType = 0; } roadSpawner.MoveRoad(roadType); plotSpawner.SpawnPlot(roadType); }
private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Obstacle")) { SetHealthTo(health - 1); // play oof audio audioSource.PlayOneShot(oof, 1f); } if (other.gameObject.CompareTag("Collectible")) { SetScoreTo(score + 1); other.gameObject.SetActive(false); // play coin audio audioSource.PlayOneShot(coin, 1f); } else { roadSpawner.MoveRoad(); } }
public void SpawnTriggerEntered() { roadSpawner.MoveRoad(); plotSpawner.SpawnPlot(); }