WoodMill() { this.Life = Data.woodMill.life; this.Citizen = Data.woodMill.citizen; this.Worker = Data.woodMill.worker; this.EnergyRequired = Data.woodMill.energyRequired; this.EnergyProduced = Data.woodMill.energyProduced; this.Wood = Data.woodMill.wood; this.Metal = Data.woodMill.metal; this.Stone = Data.woodMill.stone; this.Product = Data.woodMill.product; this.ProductionTime = Data.woodMill.productionTime; timer = new ProductionTimer(this); timer.ProductionTime = this.ProductionTime; timer.Play(); }
// if this class inherits from MonoBehaviour remove constructor and deconstructor. #region Constructors Quarry() // constructor { this.Life = Data.quarry.life; this.Citizen = Data.quarry.citizen; this.Worker = Data.quarry.worker; this.EnergyRequired = Data.quarry.energyRequired; this.EnergyProduced = Data.quarry.energyProduced; this.Wood = Data.quarry.wood; this.Stone = Data.quarry.stone; this.Metal = Data.quarry.metal; this.Product = Data.quarry.product; this.ProductionTime = Data.quarry.productionTime; timer = new ProductionTimer(this); timer.ProductionTime = this.ProductionTime; timer.Play(); }