using NaughtyAttributes; using UnityEngine; public class VampireEntity : Entity { [SerializeField] [field: Required] PlayerStats playerStats = null!; // [SerializeField] [Required] // HealthBar healthBar; [HideInInspector] public PlayerMovement playerMovement; [HideInInspector] public ScreenShaker screenShaker; protected override void Awake() { base.Awake(); transform.SetParent(arena.minionParent); screenShaker = FindObjectOfType(); } protected override void Start() { base.Start(); base.entityType = EntityFlag.Vampire; playerMovement = GetComponent(); } protected override void Update() { base.Update(); if (gameFlowManager.CanDoAction) TakeDamage(playerStats.bloodLossRate * Time.deltaTime, this, sound: false); } public override bool TakeDamage(float amount, Entity other, bool sound = true) { if (sound) { screenShaker.Shake(); } return base.TakeDamage(amount, other, sound); } public bool IsInSafeZone() => playerMovement.IsInSafeZone; protected override void OnDied() { OnEmpty(); gameFlowManager.GameOver(); } }