using Player; using UnityEngine; namespace Ai { public class BlowUpEnemy : TargetingEnemy { [SerializeField] private GameObject _blowSibling; [SerializeField] private int _count; [SerializeField] private int _stuck; [SerializeField] private float _scale; private bool _dead; protected int Stuck { set { _stuck = value; } } protected override void Init() { base.Init(); var body = GetComponent
(); if (body != null) { body.DeathEvent += OnDeath; } } private void OnDeath() { if (_stuck <= 0 || _dead) return; _dead = true; for (int i = 0; i < _count; i++) { var sib = Instantiate(_blowSibling); sib.transform.position = transform.position; var blow = sib.GetComponent