예제 #1
0
    // Start is called before the first frame update
    void Start()
    {
        bf = GetComponent <BombFollow>();
        if (bf != null)
        {
            bf.BombExp += Explode;
        }

        bs = GetComponent <BombStraight>();
        if (bs != null)
        {
            bs.BombExp += Explode;
        }
    }
예제 #2
0
    // Start is called before the first frame update
    void Start()
    {
        // subscribing to the right dmg source
        bs = GetComponent <BombStraight>();
        if (bs != null)
        {
            bs.DoDamage += DoDamage;
        }

        bf = GetComponent <BombFollow>();
        if (bf != null)
        {
            bf.DoDamage += DoDamage;
        }

        bullet = GetComponent <Bullet>();
        if (bullet != null)
        {
            bullet.DoDamage += DoDamage;
        }

        gn = GetComponent <GruntNormal>();
        if (gn != null)
        {
            gn.DoDamage += DoDamage;
        }

        laser = GetComponent <Laser>();
        if (laser != null)
        {
            laser.DoDamage += DoDamage;
        }

        player       = GameObject.FindGameObjectWithTag("Player");
        playerHealth = player.GetComponent <PlayerHealth>();
    }