Esempio n. 1
0
    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag.Equals("Enemy")) {

            e = GameObject.Find ("Enemy " + other.gameObject.name.Split (' ') [1]).GetComponent<IAenemy>();

            if (e.recibirAtaque () == 0) {
                // Ha recibido danyo
            } else {
                // Muere
                Destroy(other.gameObject);
            }
        }
        else if (other.gameObject.tag.Equals("destructible")) {

                Destroy(other.gameObject);
        }
    }
Esempio n. 2
0
    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag.Equals("Enemy")) {

            e = GameObject.Find ("Enemy " + other.gameObject.name.Split (' ') [1]).GetComponent<IAenemy>();

            if (e.recibirAtaque () == 0) {
                // Ha recibido danyo
            } else {
                // Muere

                other.gameObject.SetActive(false);
            }
        }
        // destruir MUROS
        if (other.gameObject.tag.Equals("destructible")) {

            dest = other.gameObject;

            StartCoroutine (destruirbloque());
        }
    }