Exemplo n.º 1
0
    void OnTriggerEnter2D(Collider2D collision)
    {
        string tag = collision.tag;

        switch (tag)
        {
        case collidableObjects.Enemy:
            CollidedWithEnemy(collision);
            isCollidingWithEnemy = true;
            break;

        case collidableObjects.Enemy_attack:
            CollidedWithEnemyAttack(collision);
            break;

        case collidableObjects.Orb:
            Debug.Log("AAAAAAA");
            CollidedWithOrb(collision);
            isCollidingWithOrb = true;
            break;

        case collidableObjects.Player:
            CollidedWithPlayer(collision);
            isCollidingWithPlayer = true;
            break;

        case collidableObjects.EndZone:
            healthbarClass.Kill();
            Died();
            break;

        case collidableObjects.Fire:
            isCollidingWithFire = true;
            CharacterRigidBody2LavaFall();
            break;

        case collidableObjects.Invisible:
            CollidedWithInvisible(collision);
            break;

        default:
            break;
        }
    }