コード例 #1
0
 override public void SetBasement(Plane b, PixelPosByte pos)
 {
     if (b == null)
     {
         return;
     }
     SetStructureData(b, pos);
     if (!subscribedToUpdate)
     {
         GameMaster.realMaster.labourUpdateEvent += LabourUpdate;
         subscribedToUpdate = true;
     }
     if (current != null)
     {
         current.Annihilate(true, true, false);
     }
     current = this;
     colony  = GameMaster.realMaster.colonyController;
     connectedToPowerGrid = true; isEnergySupplied = true;
     SetActivationStatus(false, true);
 }
コード例 #2
0
 override public void SetBasement(SurfaceBlock b, PixelPosByte pos)
 {
     if (b == null)
     {
         return;
     }
     SetStructureData(b, pos);
     if (!subscribedToUpdate)
     {
         GameMaster.realMaster.labourUpdateEvent += LabourUpdate;
         subscribedToUpdate = true;
     }
     isActive = true;
     if (current != null)
     {
         current.Annihilate(false);
     }
     current = this;
     colony  = GameMaster.colonyController;
     colony.accumulateEnergy = false;
     connectedToPowerGrid    = true;
 }
コード例 #3
0
 override public void Annihilate(bool forced)
 {
     if (destroyed)
     {
         return;
     }
     else
     {
         destroyed = true;
     }
     PrepareStructureForDestruction(forced);
     if (current == this)
     {
         colony.accumulateEnergy = true;
         current = null;
     }
     if (subscribedToUpdate)
     {
         GameMaster.realMaster.labourUpdateEvent -= LabourUpdate;
         subscribedToUpdate = false;
     }
     Destroy(gameObject);
 }
コード例 #4
0
 override public void Annihilate(bool clearFromSurface, bool returnResources, bool leaveRuins)
 {
     if (destroyed)
     {
         return;
     }
     else
     {
         destroyed = true;
     }
     PrepareStructureForDestruction(clearFromSurface, returnResources, leaveRuins);
     if (current == this)
     {
         colony.accumulateEnergy = true;
         current = null;
     }
     if (subscribedToUpdate)
     {
         GameMaster.realMaster.labourUpdateEvent -= LabourUpdate;
         subscribedToUpdate = false;
     }
     Destroy(gameObject);
 }