示例#1
0
 private void Update()
 {
     exitController.BlockExitControll(infoPanel.activeSelf);
     if (Input.GetButtonDown("Cancel"))
     {
         if (infoPanel.activeSelf == true)
         {
             infoPanel.SetActive(false);
             player.setMouseVisible(false);
             weaponController.Safety = false;
         }
     }
 }
    public void EndGame()
    {
        spawnManager.StopAllCoroutines();                //stop spawning enemies
        enemyList.KillAllAndClear();                     //kill all ships and clear the list to prevent a higher score;
        metalManager.StopAllCoroutines();                //stop automatic income

        exitController.BlockExitControll(true);          //prevent reseting mouse and weapon controll
        playerController.setMouseVisible(true);          //stop movement and set mouse visibel
        weaponController.Safety = true;                  //stop shooting

        mainCanvas.SetActive(false);                     // deactivate main Canvas
        loseScreen.SetActive(true);                      // activate GameOver Endscreen
        scoreText.text = "Score: " + metalManager.Score; // display Score
    }