Beispiel #1
0
        /// <summary>
        /// Clean up when it is destroyed
        /// </summary>
        public override void Destroy(DestroyMode mode = DestroyMode.Vanish)
        {
            destroyedFlag = true;

            //Check if the slotGroup is active >> deregister it
            if (slotGroup != null)
            {
                slotGroup.Notify_ParentDestroying();
                //slotGroup = null;
            }

            base.Destroy(mode);

            if ((countSteel > 0) && (steelDef != null))
            {
                // create the remaining resources as new resources at the refill position
                GenSpawn.Spawn(steelDef, refillPos, Map).stackCount = countSteel;
                countSteel = 0;
            }
            if ((countSilver > 0) && (silverDef != null))
            {
                // create the remaining resources as new resources at the refill position
                GenSpawn.Spawn(silverDef, refillPos, Map).stackCount = countSilver;
                countSilver = 0;
            }
        }
        /// <summary>
        /// Destroy and do cleanup
        /// </summary>
        /// <param name="mode"></param>
        public override void Destroy(DestroyMode mode = DestroyMode.Vanish)
        {
            //Check if the slotGroup is active >> deregister it
            if (slotGroup != null)
            {
                slotGroup.Notify_ParentDestroying();
            }

            base.Destroy(mode);
        }
Beispiel #3
0
 public override void                DeSpawn()
 {
     //Log.Message( string.Format( "{0}.DeSpawn()", this.ThingID ) );
     if (slotGroup != null)
     {
         slotGroup.Notify_ParentDestroying();
         slotGroup = null;
     }
     base.DeSpawn();
 }
Beispiel #4
0
 public override void Deregister()
 {
     base.Deregister();
     slotGroup.Notify_ParentDestroying();
 }