public override void Tick() { base.Tick(); if (this.ticksToTakeOff == maxTicksToTakeOff) { // Only spawn reinforcement pawns and supply once. SpawnRequestedReinforcements(); SpawnNecessarySupply(); UnforbidItemsToLoadInCargoBay(); } this.ticksToTakeOff--; if (this.ticksToTakeOff <= 0) { // Update requested reinforcements. Building_OrbitalRelay orbitalRelay = OG_Util.FindOrbitalRelay(OG_Util.FactionOfMAndCo); if (orbitalRelay != null) { orbitalRelay.UpdateRequestedReinforcements(); } // Spawn taking off supply ship. SupplyShipTakingOff supplyShip = ThingMaker.MakeThing(OG_Util.SupplyShipTakingOffDef) as SupplyShipTakingOff; supplyShip.InitializeLandingData(this.Position, this.Rotation); supplyShip.SetFaction(this.Faction); GenSpawn.Spawn(supplyShip, this.Position); this.Destroy(); } }
public override void Tick() { base.Tick(); if (this.reinforcementsAreSpawned == false) { // Only spawn reinforcement pawns and supply once. this.reinforcementsAreSpawned = true; UpdateRequestedReinforcements(); SpawnRequestedReinforcements(); SpawnNecessarySupply(); UnforbidItemsToLoadInCargoBay(); } if (Find.TickManager.TicksGame >= this.takeOffTick) { // Spawn taking off supply ship. SupplyShipTakingOff supplyShip = ThingMaker.MakeThing(OG_Util.SupplyShipTakingOffDef) as SupplyShipTakingOff; supplyShip.InitializeLandingData(this.Position, this.Rotation); GenSpawn.Spawn(supplyShip, this.Position); this.Destroy(); } }