public bool CheckIfAreEnoughResourcesToBuild(Transform objectToBuild) { bool rv = false; CBaseEntity myEntity = objectToBuild.GetComponent<CBaseEntity>(); // Check the costs if(player.metalLevel >= myEntity.costMetal) rv = true; return rv; }