Example #1
0
    public void SpawnTriggerEntered()
    {
        roadSpawner.MoveRoad();
        carSpawner.SpawnCar();
        pickUpSpawner.SpawnPickUp();
        environmentSpawner.SpawnTile();

        enemySpawner.SpawnEnemy();
    }
Example #2
0
    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);
    }
Example #3
0
 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();
     }
 }
Example #4
0
 public void SpawnTriggerEntered()
 {
     roadSpawner.MoveRoad();
     plotSpawner.SpawnPlot();
 }