using UnityEngine;
public class PurpleEnemy : Enemy
{
[SerializeField] private GameObject _fractions;
private float _distantion;
private void Update()
{
_distantion = Vector2.Distance(transform.position, _target.transform.position);
if (_distantion <= _distantionForAtack)
{
Burst();
}
}
private void Burst()
{
Destroy(gameObject);
}
private void OnDestroy()
{
Instantiate(_fractions, transform);
}
}
Instantiate(_fractions, transform);
Instantiate(_fractions, transform.position,transform.rotation);