Beispiel #1
0
    private void OnTriggerEnter(Collider CollisionObject)
    {
        Quaternion oppositeRotationBullet = Quaternion.LookRotation(transform.forward);

        switch (CollisionObject.tag)
        {
        case "Inimigo":
            ZombieController player = CollisionObject.GetComponent <ZombieController>();
            player.ZombieBloodMethod(transform.position, oppositeRotationBullet);
            player.GetDamage(shotDamage);
            break;

        case "Boss":
            BossController boss = CollisionObject.GetComponent <BossController>();
            boss.BossBloodMethod(transform.position, oppositeRotationBullet);
            boss.GetDamage(shotDamage);
            break;
        }
        Destroy(gameObject);
    }