void Bite(Ikillable target) { if (cdLeft <= 0) { cdLeft = biteCD; target.TakeDamage(1, Mathf.Sign(gameObject.transform.localScale.x)); } }
public void OnTriggerEnter2D(Collider2D collider) { enemy = collider.gameObject.GetComponent <Ikillable>(); if (enemy != null) { enemy.TakeDamage(1, Mathf.Sign(bulletSpeed)); } Destroy(gameObject); }