Felix Boucher 27d329df71 fix unit cost not working anymore
turns out it was an inheritance problem
2024-01-25 14:45:50 -05:00

17 lines
552 B
C#

using UnityEngine;
public abstract class UnitPlaceholder : DraggablePlaceholder
{
public int Food { get; set; }
public int Rock { get; set; }
public int Wood { get; set; }
public override void Place()
{
ResourceManager.Instance.Remove(Rock, Wood, Food);
}
public override bool CanBePlacedHere()
{
return base.CanBePlacedHere() && ResourceManager.Instance.EnoughFor(Rock, Wood, Food)
&& !LevelManager.Instance.Has<ILevelObject>(obj => obj.Position.IsContainedIn(transform.position));
}
}