public override void OnDamaged(IInteractable attacker, int damage, Vector2 knockback) { if (attacker.Equals(currentHead)) { currentHead = null; } hitStateEndTime = Time.time + 1f; attackEnabled = false; spriteRenderer.sprite = HitBodySprite; base.OnDamaged(attacker, damage, knockback); }
private void LaunchHead() { currentHead = Instantiate(SpareHead, transform); currentHead.gameObject.SetActive(true); nextHeadLaunch = Time.time + HeadLaunchInterval; }