basically the whole game
This commit is contained in:
parent
949135cecb
commit
96dcfa9064
315 changed files with 34386 additions and 396 deletions
43
Assets/Scripts/Entities/ZombieFairy.cs
Normal file
43
Assets/Scripts/Entities/ZombieFairy.cs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class ZombieFairy : Enemy
|
||||
{
|
||||
[SerializeField] private Ability deathAbility;
|
||||
[SerializeField] private bool hasDiedOnce;
|
||||
[SerializeField] private float disappearanceTime;
|
||||
private float currentDisappearanceTime;
|
||||
protected override void OnDeath()
|
||||
{
|
||||
if (!hasDiedOnce)
|
||||
{
|
||||
hasDiedOnce = true;
|
||||
health = maxHealth;
|
||||
invulnerable = true;
|
||||
isStalled = true;
|
||||
currentDisappearanceTime = disappearanceTime;
|
||||
sprite.color = Color.black;
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(gameObject);
|
||||
WaveManager.instance.enemiesInPlay.Remove(this);
|
||||
WaveManager.instance.UpdateKills();
|
||||
}
|
||||
deathAbility.TryAbility();
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
if (currentDisappearanceTime > 0)
|
||||
{
|
||||
currentDisappearanceTime -= Time.deltaTime;
|
||||
if (currentDisappearanceTime <= 0)
|
||||
{
|
||||
invulnerable = false;
|
||||
isStalled = false;
|
||||
sprite.color = Color.white;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue