Walls + Start Arrow

This commit is contained in:
Crizomb 2025-01-14 13:11:00 +01:00
parent 7da33be977
commit 33467f6cc4
71 changed files with 4255 additions and 81 deletions

View file

@ -1,11 +1,49 @@
using UnityEngine;
public enum DeathSate
{
NotImportant = 0,
QueenADead = 1,
QueenBDead = 2,
}
public abstract class AbstractUnit : MonoBehaviour
{
public float price;
[field: SerializeField] public bool IsTeamA { get; private set; }
[field: SerializeField] public bool IsQueen { get; private set; }
public abstract bool Attack();
public abstract void TakeDamage(float damage);
void Awake()
{
if (IsTeamA)
{
GlobalsVariable.AliveUnitsTeamA.Add(this);
if (IsQueen) GlobalsVariable.QueenA = this;
}
else
{
GlobalsVariable.AliveUnitsTeamB.Add(this);
if (IsQueen) GlobalsVariable.QueenB = this;
}
}
public DeathSate AbstractDeath()
{
if (IsTeamA)
{
GlobalsVariable.AliveUnitsTeamA.Remove(this);
if (IsQueen) return DeathSate.QueenADead;
}
else
{
GlobalsVariable.AliveUnitsTeamB.Remove(this);
if (IsQueen) return DeathSate.QueenBDead;
}
return DeathSate.NotImportant;
}
}