Exemplo n.º 1
0
 void OnMouseOver()
 {
     if (Input.GetMouseButtonDown(0))
     {
         Destroy(gameObject);
         Lives.HurtPlayer(pointsToDead);
         print("Red_Destroy");
     }
 }
Exemplo n.º 2
0
    void OnCollisionEnter2D(Collision2D coll)
    {
        Destroy(GameObject.FindGameObjectWithTag("player"));
        if (GameObject.FindGameObjectWithTag("player"))
        {
            Lives.HurtPlayer(pointsToDead);
        }


        //	Application.LoadLevel (leveltoload);
    }
Exemplo n.º 3
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player"))
     {
         other.gameObject.SetActive(false);
         if (respawning == true)
         {
             lives.GameOver();
         }
         lives.HurtPlayer();
         respawning = true;
         StartCoroutine(Respawn(other.gameObject));
     }
 }