Пример #1
0
 void OnTriggerEnter(Collider col)
 {
     for (int i = 0; i < tagNames.Length; i++)
     {
         if (col.gameObject.tag == tagNames[i])
         {
             destroyableObj.die();
         }
     }
 }
Пример #2
0
    void Update()
    {
        if (Input.GetKey(restart))
        {
            SceneManager.LoadScene(SceneManager.GetActiveScene().name);
        }

        if (Input.GetKey(explode))
        {
            player.die();
        }

        if (Input.GetKey(spawning) && spawnActivator)
        {
            StartCoroutine(spawn(spawner));
        }

        if (Input.GetKey(KeyCode.Escape))
        {
            Application.Quit();
        }
    }