// 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; } }
// 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>(); }