Ejemplo n.º 1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        DropletController dropletController = collision.GetComponent <DropletController>();

        if (dropletController != null)
        {
            SuckUpDroplet(dropletController);
        }

        BirdController birdController = collision.GetComponent <BirdController>();

        if (birdController != null)
        {
            if (isAcid)
            {
                birdController.AcidDeath();
            }
            else
            {
                EnemyHit();
            }
        }

        UFOController ufoController = collision.GetComponent <UFOController>();

        if (ufoController != null)
        {
            if (isAcid)
            {
                ufoController.AcidDeath();
            }
            else
            {
                EnemyHit();
            }
        }

        LightningController lightningController = collision.GetComponent <LightningController>();

        if (lightningController != null)
        {
            EnemyHit();
        }

        AcidDropletController acidDropletController = collision.GetComponent <AcidDropletController>();

        if (acidDropletController != null)
        {
            SuckUpAcidDroplet(acidDropletController);
        }
    }