void Update()
    {
        if (Input.GetKeyDown(KeyCode.L))
        {
            levelManagerScript.LoadLose();
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            levelManagerScript.EndGame();
        }

        if (Input.GetKeyDown(KeyCode.Q))
        {
            debugMode = !debugMode;
        }
    }
示例#2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "Enemy")
     {
         GameObject         LevelManager       = (GameObject)GameObject.Find("LevelManager");
         LevelManagerScript levelManagerScript = LevelManager.GetComponent <LevelManagerScript>();
         levelManagerScript.LoadLose();
     }
     Destroy(collision.gameObject);
 }