Example #1
0
    public void OnTriggerEnter(Collider other)
    {
        //Chiusura serranda
        if (other.CompareTag("Player") && gameObject.name.Equals("shutter1"))
        {
            shutter1.GetComponent <Animator>().SetTrigger("Close");
        }

        //Se il boss tocca la zona dove atterra, succede quanto segue:
        if (other.gameObject.CompareTag("MiniBoss") && gameObject.name.Equals("Miniboss_spawn"))
        {
            boss_is_active = true;
            Destroy(gameObject);
        }

        //Chiudo la porta quando mi ci avvicino ad essa (รจ la porta di uscita dalla mini boss fight)
        if (other.CompareTag("Player") && gameObject.name.Equals("boss_door") && !boss_is_active)
        {
            boss_door1.GetComponent <Animator>().SetTrigger("Close");
            boss1.SetActive(true);
            hud.bossBarEnabler(true);
            hud.bossNameSetter("Gente Mala");
        }
    }