예제 #1
0
    void OnTriggerExit(Collider other)
    {
        if (other.tag == "Boundary" || other.tag == "Laser" || other.tag == "FireUp")                   //Do nothing if the other object is of
        {                                                                                               // there tags
            return;
        }
        if (other.tag == "Player")                                                                                                                      // If player then initiate GameOver
        {
            Instantiate(playerExplosion, other.transform.position, other.transform.rotation);
            Handheld.Vibrate();                 //Vibrating the mobile device
            gameController.GameOver();


            other.gameObject.SetActive(false);
        }

        Instantiate(explosion, transform.position, transform.rotation);                                         // Show Explosion
        gameController.AddScore(newScoreValue: scoreValue);                                                     // Increment Score
        if (other.tag != "Player")                                                                              //If not player then destroy both objects
        {
            Destroy(other.gameObject);
        }
        Destroy(gameObject);
    }
 private void GameOver(GameObject obs)
 {
     gamecontroller.GameOver(obs);
 }
예제 #3
0
 public void Die()
 {
     gameController.GameOver();
 }