public void Build(Species s) { if (!CanBuild(s)) { return; } Biomass -= s.CostNext(); s.Build(); }
private void Update() { if (species != null) { BuildButton.GetComponentInChildren <Text>().text = "" + species.CostNext(); BuildButton.interactable = game.CanBuild(species); DestroyButton.GetComponentInChildren <Text>().text = "" + species.CostPrevious(); DestroyButton.interactable = game.CanDestroy(species); Quantity.text = "" + species.count; } }
public bool CanBuild(Species s) { return(Biomass >= s.CostNext()); }