- Home /
Price on a building
Hey so i have made a base class for all my buildings so the all get these things but about this is about the prices to build a building should i write it in the base class and then in the inspector write how much they cost or should i write it in the script for the building so i do it on every building scrip?
public string buildingName;
public string buildingID;
public int health;
public int deathHealth;
public int startLVL;
public int currentLVL;
public int maxLVL;
public float priceGold, priceWood, priceStone, priceCoal, priceCopper, priceIron, priceDiamond;
Answer by Klarax · Feb 10, 2020 at 01:01 PM
personally. i think id make a new class of building costs, so it could be used on other parts of the game.
eg. if you have a menu etc, it can look at the class of costs rather than on a building itself since a menu wont have a building referenced against it.
Your answer
Follow this Question
Related Questions
Finding enemies from a list script 1 Answer
How to change mesh renderer of the 3d object with code 0 Answers
How to make walls connect together automatically? 0 Answers
Lots of Fixed Joints 0 Answers
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers